From 6e9f5c189e2ebeafaae6fb2d7bdee4eb893bee15 Mon Sep 17 00:00:00 2001 From: aweso Date: Tue, 6 Jan 2026 19:09:58 +0900 Subject: [PATCH] =?UTF-8?q?=EC=BB=A4=EC=84=9C=20=EB=A3=B0=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit πŸ€– Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- .cursorrules | 1 + git-auto.ps1 | 30 ++++++++++++++++++++++-------- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/.cursorrules b/.cursorrules index 7484243..8bddb0a 100644 --- a/.cursorrules +++ b/.cursorrules @@ -28,6 +28,7 @@ g "μž‘μ—… μš”μ•½ λ‚΄μš©" ``` 이 λͺ…λ Ήμ–΄λŠ” `git add .`, `git commit -m "λ©”μ‹œμ§€"`, `git push`λ₯Ό μžλ™μœΌλ‘œ μ‹€ν–‰ν•©λ‹ˆλ‹€. +- `git push`λŠ” μ‹€νŒ¨ μ‹œ μ΅œλŒ€ 2λ²ˆκΉŒμ§€ μžλ™μœΌλ‘œ μž¬μ‹œλ„ν•©λ‹ˆλ‹€. ### μ£Όμ˜μ‚¬ν•­ - μ‚¬μš©μžκ°€ λͺ…μ‹œμ μœΌλ‘œ μš”μ²­ν•˜μ§€ μ•ŠλŠ” ν•œ μ‹€μ œλ‘œ git λͺ…λ Ήμ–΄λ₯Ό μ‹€ν–‰ν•˜μ§€ λ§ˆμ„Έμš” diff --git a/git-auto.ps1 b/git-auto.ps1 index 87c7776..47e3cfd 100644 --- a/git-auto.ps1 +++ b/git-auto.ps1 @@ -34,15 +34,29 @@ function g { Write-Host "βœ… git commit μ™„λ£Œ" -ForegroundColor Green Write-Host "" - # 3. git push - Write-Host "β–Ά git push μ‹€ν–‰ 쀑..." -ForegroundColor Yellow - git push - if ($LASTEXITCODE -ne 0) { - Write-Host "❌ git push μ‹€νŒ¨" -ForegroundColor Red - Write-Host " (원격 μ €μž₯μ†Œ 섀정을 ν™•μΈν•˜μ„Έμš”)" -ForegroundColor Yellow - return + # 3. git push (μ΅œλŒ€ 2번 μž¬μ‹œλ„) + $pushAttempt = 0 + $maxPushAttempts = 2 + $pushSuccess = $false + + while ($pushAttempt -lt $maxPushAttempts -and -not $pushSuccess) { + $pushAttempt++ + Write-Host "β–Ά git push μ‹€ν–‰ 쀑... (μ‹œλ„ $pushAttempt/$maxPushAttempts)" -ForegroundColor Yellow + git push + if ($LASTEXITCODE -eq 0) { + Write-Host "βœ… git push μ™„λ£Œ" -ForegroundColor Green + $pushSuccess = $true + } else { + if ($pushAttempt -lt $maxPushAttempts) { + Write-Host "⚠️ git push μ‹€νŒ¨, μž¬μ‹œλ„ 쀑... ($pushAttempt/$maxPushAttempts)" -ForegroundColor Yellow + Start-Sleep -Seconds 2 + } else { + Write-Host "❌ git push μ‹€νŒ¨ (μ΅œλŒ€ μž¬μ‹œλ„ 횟수 도달)" -ForegroundColor Red + Write-Host " (원격 μ €μž₯μ†Œ 섀정을 ν™•μΈν•˜μ„Έμš”)" -ForegroundColor Yellow + return + } + } } - Write-Host "βœ… git push μ™„λ£Œ" -ForegroundColor Green Write-Host "" Write-Host "========================================" -ForegroundColor Cyan