soyailabs / setup_remote.ps1
SOY NV AI
๋ฉ”ํƒ€๋ฐ์ดํ„ฐ ์ƒ์„ฑ ๊ธฐ๋Šฅ ๊ฐœ์„ : ๊ธฐ์กด ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ ๋ณ‘ํ•ฉ ๋ฐ ํšŒ์ฐจ ์ •๋ณด ์œ ์ง€
d234e06
raw
history blame
2.05 kB
# 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