File size: 2,047 Bytes
9fa456d b834258 c2280e3 |
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 |
# Git ์๊ฒฉ ์ ์ฅ์ ์ค์ ์คํฌ๋ฆฝํธ
# ์ฌ์ฉ๋ฒ: .\setup_remote.ps1
Write-Host "=== Git ์๊ฒฉ ์ ์ฅ์ ์ค์ ===" -ForegroundColor Cyan
Write-Host ""
# ํ์ฌ ์๊ฒฉ ์ ์ฅ์ ํ์ธ
$currentRemote = git remote -v
if ($currentRemote) {
Write-Host "ํ์ฌ ์๊ฒฉ ์ ์ฅ์:" -ForegroundColor Yellow
Write-Host $currentRemote
Write-Host ""
$overwrite = Read-Host "์๊ฒฉ ์ ์ฅ์๊ฐ ์ด๋ฏธ ์์ต๋๋ค. ๋ฎ์ด์ฐ์๊ฒ ์ต๋๊น? (y/n)"
if ($overwrite -ne "y") {
Write-Host "์ทจ์๋์์ต๋๋ค." -ForegroundColor Red
exit
}
git remote remove origin
}
# ์๊ฒฉ ์ ์ฅ์ URL ์
๋ ฅ
Write-Host ""
Write-Host "์๊ฒฉ ์ ์ฅ์ URL์ ์
๋ ฅํ์ธ์:" -ForegroundColor Green
Write-Host "์์: https://github.com/username/soy-nv-ai.git" -ForegroundColor Gray
Write-Host " git@github.com:username/soy-nv-ai.git" -ForegroundColor Gray
Write-Host ""
$remoteUrl = Read-Host "์๊ฒฉ ์ ์ฅ์ URL"
if ([string]::IsNullOrWhiteSpace($remoteUrl)) {
Write-Host "URL์ด ์
๋ ฅ๋์ง ์์์ต๋๋ค. ์ทจ์ํฉ๋๋ค." -ForegroundColor Red
exit
}
# ์๊ฒฉ ์ ์ฅ์ ์ถ๊ฐ
Write-Host ""
Write-Host "์๊ฒฉ ์ ์ฅ์๋ฅผ ์ถ๊ฐํ๋ ์ค..." -ForegroundColor Yellow
git remote add origin $remoteUrl
# ์๊ฒฉ ์ ์ฅ์ ํ์ธ
Write-Host ""
Write-Host "์๊ฒฉ ์ ์ฅ์๊ฐ ์ถ๊ฐ๋์์ต๋๋ค:" -ForegroundColor Green
git remote -v
# ํธ์ ์ฌ๋ถ ํ์ธ
Write-Host ""
$push = Read-Host "๋ง์คํฐ ๋ธ๋์น๋ฅผ ์๊ฒฉ ์ ์ฅ์์ ํธ์ํ์๊ฒ ์ต๋๊น? (y/n)"
if ($push -eq "y") {
Write-Host ""
Write-Host "ํธ์ํ๋ ์ค..." -ForegroundColor Yellow
git push -u origin master
Write-Host ""
Write-Host "ํธ์๊ฐ ์๋ฃ๋์์ต๋๋ค!" -ForegroundColor Green
} else {
Write-Host ""
Write-Host "ํธ์๋ฅผ ๊ฑด๋๋ฐ์์ต๋๋ค. ๋์ค์ ๋ค์ ๋ช
๋ น์ผ๋ก ํธ์ํ ์ ์์ต๋๋ค:" -ForegroundColor Yellow
Write-Host " git push -u origin master" -ForegroundColor Cyan
}
Write-Host ""
Write-Host "=== ์๋ฃ ===" -ForegroundColor Green
|