쉬운 개발을 위해 하나의 구조에 10 개 이상의 리포지토리를 집계하기 위해 git 서브 모듈을 사용하려고합니다.리모트 브랜치를 추적하기위한 Git 서브 모듈
모듈을 복제하고 분기를 체크 아웃해야합니다. 대신 모듈이 분리 헤드 모드로 체크 아웃됩니다.
git clone [email protected]:org/global-repository.git
git submodule update —init
cd config-framework
git status
$git status
#HEAD detached at b932ab5
nothing to commit, working directory clean
파일 우리는 MY_BRANCH 지점이 아니라 분리 된 머리보다 기본적으로 체크 아웃 할
$cat .gitmodules
[submodule "config-framework"]
path = config-framework
url = [email protected]:org/config-framework.git
branch = MY_BRANCH
괜찮을 것 같다 gitmodules. 어떻게 달성 할 수 있습니까?
이것은 서브 모듈이 작동하는 방식입니다. 마스터 프로젝트는 분기가 아닌 특정 커밋을 참조합니다. – twalberg