DOCS/troubleshooting/250920_happybell80_gateway_git_sync_issue.md
happybell80 dab018f79d 문서 파일명 규칙 적용: Gateway Git 동기화 이슈
- 파일명 변경: gateway-git-sync-issue.md → 250920_happybell80_gateway_git_sync_issue.md
- 작성자 및 작성일 정보 추가 (happybell80, 2025-09-20)
- DOCS 파일명 규칙 통일

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 15:08:22 +09:00

1.3 KiB

Gateway Git 동기화 이슈

작성일: 2025-09-20

작성자: happybell80

발생 상황 (2025-09-20)

  • git status에서 이미 커밋된 파일이 "untracked files"로 표시
  • 실제 파일은 최신이지만 git 히스토리는 8월 20일 상태

조사 결과

시간대별 분석

  • 8월 20일: 마지막 정상 git pull
  • 9월 15일: rate_limiter.py 커밋/push
  • 9월 20일 00:18: Actions 자동 배포
  • 9월 20일 00:28: git pull 충돌 발생

원인 발견

Actions deploy.yml에서 rsync --exclude='.git' 사용

  • 파일은 복사되지만 .git 폴더는 제외
  • 결과: 파일 시스템은 최신, git 히스토리는 과거

실제 상황

폴더 파일: rate_limiter.py (9월 15일 버전)
.git HEAD: 8월 20일 (rate_limiter.py 없음)
git 인식: "누가 만든지 모르는 새 파일"

교훈

배포된 파일 ≠ git 히스토리

  • Actions rsync는 파일만 업데이트
  • 컨테이너는 최신 코드지만 git은 과거 상태 가능
  • 서버 작업 시 git status 필수

해결 방법

git fetch origin
git reset --hard origin/main

장단점

현재 방식 장점

  • 로컬 충돌 없이 깨끗한 배포
  • 백업/롤백 용이
  • git 문제로 배포 실패 방지

단점

  • git 히스토리 관리 시 추가 작업 필요