From 598512e418d1d9d2053fc5f74459b09ef6bc396b Mon Sep 17 00:00:00 2001 From: happybell80 Date: Sat, 20 Sep 2025 01:12:25 +0900 Subject: [PATCH] =?UTF-8?q?docs:=20Gateway=20Git=20=EB=8F=99=EA=B8=B0?= =?UTF-8?q?=ED=99=94=20=EC=9D=B4=EC=8A=88=20=EB=AC=B8=EC=84=9C=ED=99=94=20?= =?UTF-8?q?-=20Actions=20rsync=EC=99=80=20git=20=ED=9E=88=EC=8A=A4?= =?UTF-8?q?=ED=86=A0=EB=A6=AC=20=EB=B6=88=EC=9D=BC=EC=B9=98=20=EB=AC=B8?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- troubleshooting/gateway-git-sync-issue.md | 45 +++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 troubleshooting/gateway-git-sync-issue.md diff --git a/troubleshooting/gateway-git-sync-issue.md b/troubleshooting/gateway-git-sync-issue.md new file mode 100644 index 0000000..a4d2038 --- /dev/null +++ b/troubleshooting/gateway-git-sync-issue.md @@ -0,0 +1,45 @@ +# Gateway Git 동기화 이슈 + +## 발생 상황 (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` 필수 + +## 해결 방법 +```bash +git fetch origin +git reset --hard origin/main +``` + +## 장단점 +### 현재 방식 장점 +- 로컬 충돌 없이 깨끗한 배포 +- 백업/롤백 용이 +- git 문제로 배포 실패 방지 + +### 단점 +- git 히스토리 관리 시 추가 작업 필요 \ No newline at end of file