Git:Submodules
Command
-
git submodule add {repository_url}
- 서브 모듈을 추가한다.
-
git submodule init
- 초기화 한다. 저장소 clone 이후 실행해야 한다.
-
git submodule update
- 갱신된 모듈을 업데이트 한다.
Remove submodule
서브모듈 제거 방법은 아래와 같다.
- Delete the relevant section from the
.gitmodules
file. - Stage the .gitmodules changes
git add .gitmodules
- Delete the relevant section from
.git/config
. - Run
git rm --cached path_to_submodule
(no trailing slash). - Run
rm -rf .git/modules/path_to_submodule
- Commit
git commit -m "Removed submodule {name}"
- Delete the now untracked submodule files
-
rm -rf path_to_submodule