-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit-git.ps1
More file actions
101 lines (81 loc) · 3.12 KB
/
Copy pathinit-git.ps1
File metadata and controls
101 lines (81 loc) · 3.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# NetBoozt - Git Setup Script
# Inicializa el repositorio y hace el primer commit
Write-Host @"
╔══════════════════════════════════════════════════════════════╗
║ NetBoozt - Git Initialization ║
╚══════════════════════════════════════════════════════════════╝
"@ -ForegroundColor Cyan
$repoPath = "L:\NetworkFailover\NetBoozt"
$remoteUrl = "git@github.com:LOUST-PRO/NetBoozt_InternetUpgrade.git"
Write-Host "`n📦 Inicializando repositorio Git..." -ForegroundColor Yellow
cd $repoPath
# Verificar si ya existe .git
if (Test-Path ".git") {
Write-Host "⚠️ .git ya existe. ¿Eliminar y reiniciar? (Y/N)" -ForegroundColor Yellow
$response = Read-Host
if ($response -eq "Y") {
Remove-Item -Path ".git" -Recurse -Force
Write-Host "✅ .git eliminado" -ForegroundColor Green
} else {
Write-Host "❌ Operación cancelada" -ForegroundColor Red
exit
}
}
# Inicializar Git
Write-Host "`n🔧 Ejecutando git init..." -ForegroundColor Cyan
git init
# Configurar usuario (opcional)
Write-Host "`n👤 Configurar usuario Git (opcional):" -ForegroundColor Cyan
$userName = Read-Host "Nombre (deja vacío para usar global)"
if ($userName) {
git config user.name $userName
}
$userEmail = Read-Host "Email (deja vacío para usar global)"
if ($userEmail) {
git config user.email $userEmail
}
# Crear .gitattributes
Write-Host "`n📝 Creando .gitattributes..." -ForegroundColor Cyan
@"
# Auto detect text files and perform LF normalization
* text=auto
# Explicitly declare files
*.py text
*.md text
*.txt text
*.json text
*.yaml text
*.yml text
# Denote binary files
*.png binary
*.jpg binary
*.ico binary
"@ | Out-File -FilePath ".gitattributes" -Encoding UTF8
# Agregar archivos
Write-Host "`n➕ Agregando archivos al staging..." -ForegroundColor Cyan
git add .
# Primer commit
Write-Host "`n💾 Creando primer commit..." -ForegroundColor Cyan
git commit -m "🚀 Initial commit - NetBoozt v1.0.0
- Windows network optimization module
- Modern GUI with ttkbootstrap
- 15+ TCP/IP optimizations
- Speedtest-cli integration
- Complete documentation
- Mermaid architecture diagrams
- Conservative/Balanced/Aggressive profiles
By LOUST (www.loust.pro)"
# Crear branch main
Write-Host "`n🌿 Creando branch 'main'..." -ForegroundColor Cyan
git branch -M main
# Agregar remote
Write-Host "`n🔗 Agregando remote 'origin'..." -ForegroundColor Cyan
git remote add origin $remoteUrl
Write-Host "`n✅ Repositorio inicializado correctamente!" -ForegroundColor Green
Write-Host "`n📤 Para hacer push:" -ForegroundColor Yellow
Write-Host " git push -u origin main" -ForegroundColor White
Write-Host "`n📊 Estado del repositorio:" -ForegroundColor Cyan
git status
Write-Host "`n🎯 Siguiente paso:" -ForegroundColor Yellow
Write-Host " cd $repoPath" -ForegroundColor White
Write-Host " git push -u origin main" -ForegroundColor White