Updating git submodule

-  이미 추가된 submodule의 최신 commit으로 업데이트 할 경우

상위 깃: A

submodule: B


cd B

# 현재 최신 커밋이 올라온 브랜치로 변경. 현재 브랜치는 submodule로 생성된 임시(?) 브랜치임

git checkout {branch_name}

# 필요시 pull: git pull origin {branch_name}

cd ..

git add B

git commit -m "{commit message}"

git push origin {branch_name}


submodule 안의 코드를 수정하고, my_branch에 커밋한 뒤 상위 깃에서 add 혹은 git submodule update을 수행해도 변경사항이 적용되지 않는 이유가 my_branch가 아닌 해시로 보이는 다른 브랜치가 생성되어 submodule이 그 브랜치를 추종하고 있기 때문이었음

댓글

이 블로그의 인기 게시물

sklearn tsne + matplotlib scatter

Implementation of Focal Loss using Pytorch