76 lines
3.1 KiB
Markdown
76 lines
3.1 KiB
Markdown
# GitHub Migration to Local Project - 20250715
|
|
|
|
## 문제 상황
|
|
- admin@robeing-brains:~/github-migration에 있는 프로젝트 폴더들을 happybell80 사용자의 로컬 프로젝트로 이전
|
|
- 각 폴더의 git remote URL에 기존 ivada_Ro-being 사용자의 토큰이 설정되어 있음
|
|
- 일부 저장소는 Gitea에서 다른 이름으로 리다이렉트되거나 존재하지 않음
|
|
|
|
## 해결 과정
|
|
|
|
### 1. 폴더 복사
|
|
```bash
|
|
# 각 폴더를 로컬로 복사
|
|
cp -r /home/admin/github-migration/DOCS /home/happybell80/my_project/
|
|
cp -r /home/admin/github-migration/admin_page /home/happybell80/my_project/
|
|
cp -r /home/admin/github-migration/api-base /home/happybell80/my_project/
|
|
cp -r /home/admin/github-migration/frontend-base /home/happybell80/my_project/
|
|
cp -r /home/admin/github-migration/nginx-infra /home/happybell80/my_project/
|
|
cp -r /home/admin/github-migration/test /home/happybell80/my_project/
|
|
cp -r /home/admin/github-migration/test_front /home/happybell80/my_project/
|
|
cp -r /home/admin/github-migration/test_meta-skill /home/happybell80/my_project/
|
|
|
|
# 추가 설정 파일들 복사
|
|
cp /home/admin/BACKUP_TO_NAS_POLICY.md /home/happybell80/my_project/
|
|
cp /home/admin/CLAUDE.md /home/happybell80/my_project/
|
|
cp /home/admin/ROBEING_ARCHITECTURE_PHILOSOPHY.md /home/happybell80/my_project/
|
|
```
|
|
|
|
### 2. Git Remote 토큰 업데이트
|
|
각 폴더에서 happybell80 사용자의 개인 액세스 토큰으로 변경:
|
|
```bash
|
|
# 예시: DOCS 폴더
|
|
cd /home/happybell80/my_project/DOCS
|
|
git remote set-url origin https://happybell80:8676690e3b33291abfed9294c8d06044ec48d7a0@git.ro-being.com/ivada_Ro-being/docs.git
|
|
```
|
|
|
|
### 3. 저장소 상태 확인 및 정리
|
|
|
|
#### 성공한 저장소들:
|
|
- **DOCS**: 정상 pull 완료
|
|
- **frontend-base**: 정상 pull 완료 (업데이트 있음)
|
|
- **nginx-infra**: 정상 pull 완료
|
|
- **test_meta-skill**: 정상 pull 완료
|
|
|
|
#### 폴더명 변경 (리다이렉트):
|
|
- **api-base → rb8001**: Gitea에서 rb8001로 리다이렉트됨
|
|
- **test → rb10508_test**: Gitea에서 rb10508_test로 리다이렉트됨
|
|
|
|
#### 리모트 제거 (저장소 없음):
|
|
- **admin_page**: 저장소가 존재하지 않아 remote 제거
|
|
- **test_front**: 저장소가 존재하지 않아 remote 제거
|
|
|
|
### 4. 최종 명령어 예시
|
|
```bash
|
|
# 폴더명 변경
|
|
mv api-base rb8001
|
|
mv test rb10508_test
|
|
|
|
# 리모트 제거
|
|
cd admin_page && git remote remove origin
|
|
cd test_front && git remote remove origin
|
|
|
|
# 업데이트된 URL로 리모트 설정
|
|
cd rb8001 && git remote set-url origin https://happybell80:TOKEN@git.ro-being.com/ivada_Ro-being/rb8001.git
|
|
cd rb10508_test && git remote set-url origin https://happybell80:TOKEN@git.ro-being.com/ivada_Ro-being/rb10508_test.git
|
|
```
|
|
|
|
## 결과
|
|
- 총 8개 폴더 이전 완료
|
|
- 6개 저장소 정상 연결 (4개 기존명, 2개 새명)
|
|
- 2개 저장소 리모트 제거 (존재하지 않음)
|
|
- 모든 저장소가 happybell80 사용자 토큰으로 업데이트됨
|
|
|
|
## 교훈
|
|
1. 저장소 이전시 실제 Gitea 저장소명과 로컬 폴더명 일치 확인 필요
|
|
2. 저장소 존재 여부 확인 후 리모트 설정 필요
|
|
3. 개인 액세스 토큰 교체 시 모든 저장소 일괄 업데이트 필요 |