제로부터 쌓는 개발일지
article thumbnail
Published 2023. 11. 12. 01:51
Git. Repository 병합 Dev Setup
반응형

초기설정

  • 여러 레포지토리를 병합할 레포지토리를 만든 뒤 별도의 폴더를 생성하고 깃 클론
# 먼저 해당 위치에 새로운 git 저장소를 생성하기 위해
$ git init

# 위에서 만들었던 새로운 리포지토리 주소를 복사해서 넣어 clone한다.
$ git clone https://github.com/chaehyuenwoo/Itwill_PlayGround.git

 

Clone 한 Repository에 commit 기록 남기기

$ git add .$ git commit -m 'commit test'

 

레포지토리 병합

$ git subtree add --prefix=기존리포지토리명 기존리포지토리주소 기존브랜치명

# EX)
$ git subtree add --prefix=Workspace https://github.com/chaehyuenwoo/Spring5.0.git main

 

새롭게 만든 Repository에 Push

$ git push origin HEAD:main --force
fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

 

 

레퍼런스

[Git] GitHub 여러 Repository 합치기 간단 총 정리

반응형
profile

제로부터 쌓는 개발일지

@PachyuChepe

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!

profile on loading

Loading...