less than 1 minute read

별다른 설정이 없으면 서브모듈의 HEAD 커밋은 DETACHED로 지정된다.

git branch
* (HEAD detached at 3edd422)
  develop
  master

이는 git submodule update 기본 옵션이 checkout 이기 떄문이며, 커밋에 저장된 work directory만 가져온다. (git checkout과 의미가 같음)

Detached HEAD 인 경우 git checkout {branch-name}으로 작업할 브랜치로 HEAD를 옮겨주고 작업하면 된다.

또는 다음 명령어로 일괄 변경해줘도 된다.

git submodule foreach 'git checkout develop || true'

Tags:

Categories:

Updated:

Leave a comment