git submodule
git submodule
git 저장소 안에 다른 git 저장소를 둘 수 있게 하여, 두 git 저장소 모두 독립적으로 관리할 수 있다.submodule 추가하기
.gitmodules라는 이름의 파일로 관리된다.git submodule add { 서브모듈 원격 Repository 주소 } { 서브모듈 루트 디렉토리 경로 }
업데이트
Master Repository를 Clone하면 Slave Repository의 루트 디렉토리는 비어있는 상태로 저장된다. 이는 서브모듈을 사용하더라도 Repository간 독립성이 유지되기 때문에 발생하는 현상입니다. .gitmodules 파일이 올바르게 작성되어 있는 경우, 다음 명령어를 입력하여 서브모듈의 내용을 가져올 수 있습니다.git submodule initgit submodule updatesubmodule까지 함께 clone
원격 저장소를 Clone할 때, recursive 옵션을 주면 포함된 서브모듈까지 함께 Clone할 수 있다.git clone –recursive { 원격 Repository 주소 }
댓글
댓글 쓰기