-
[Github] repository 합치기공부 2021. 12. 28. 16:43
1. 깃허브에 기존 레포지토리를 합칠 새로운 레포지토리를 만든다.
2. 1번의 레포지토리를 git clone 해준다.
3. cd 레포지토리명 을 입력하고 해당 폴더(1의 폴더)로 이동한다.
4. subtree를 이용하여 합친다.
git subtree add --prefix=(해당 Repository 하위의 디렉터리 명) (옮겨올 Repository 주소) (옮겨올 Repository의 branch)
예시) git subtree add --prefix=vue-practice https://github.com/djWjrh/어쩌고저쩌고.git main
여기에서 아래의 오류가 발생한다면
fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
터미널에 아래 코드를 입력한다. (참고: stack overflow)
git commit --allow-empty -n -m "Initial commit."
5. 합칠 레포를 모두 추가해준 후, git push origin main 으로 1번의 레포지토리에 업데이트 해준다.
'공부' 카테고리의 다른 글
[Next.js] SEO - 6. Monitoring your Core Web Vitals (0) 2021.11.09 [Next.js] SEO - 5. Improving your Core Web Vitals (0) 2021.11.08 [Next.js] SEO - 4. Web Performance & Core Web Vitals (0) 2021.11.05 [Next.js] SEO - 3. Rendering and Ranking (0) 2021.11.03 [Next.js] SEO - 2. Crawling and Indexing (0) 2021.11.02