docs: Gateway Git 동기화 이슈 문서화 - Actions rsync와 git 히스토리 불일치 문제
This commit is contained in:
parent
6bd22f0a3f
commit
598512e418
45
troubleshooting/gateway-git-sync-issue.md
Normal file
45
troubleshooting/gateway-git-sync-issue.md
Normal file
@ -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 히스토리 관리 시 추가 작업 필요
|
||||
Loading…
x
Reference in New Issue
Block a user