본문 바로가기
Git(형상 관리)

[Git] Subtree - 하나의 저장소에서 여러 repo 관리하기

by Taehyung Kim, dev 2020. 12. 19.
728x90

A-Sample, B-Sample, C-Sample Repository 를 Z-Sample 폴더에서 관리하기.

 

1. Base Repository clone

  • 먼저 Github이나 Gitlab 같은 저장소에 Repository 를 만듭니다.
  • 그 후 Clone 합니다.
$ git clone https://github.com/{사용자 이름}/Z-Sample.git

 

 

2. 저장소 가져오기

  • subtree 명령어를 이용하여 저장소 데이터를 가져옵니다.
$ git subtree add --prefix=A-Sample https://github.com/{사용자 이름}/A-Sample.git master

$ git subtree add --prefix=B-Sample https://github.com/{사용자 이름}/B-Sample.git master

$ git subtree add --prefix=C-Sample https://github.com/{사용자 이름}/C-Sample.git master

3. remote 저장소로 push

$ git push

결과

 

728x90

'Git(형상 관리)' 카테고리의 다른 글

[Git] Subtree 관리하기(push, pull)  (0) 2020.12.19

댓글