Skip to content

Git:Submodules

Command

git submodule add {repository_url}
서브 모듈을 추가한다.
git submodule init
초기화 한다. 저장소 clone 이후 실행해야 한다.
git submodule update
갱신된 모듈을 업데이트 한다.

Remove submodule

서브모듈 제거 방법은 아래와 같다.

  1. Delete the relevant section from the .gitmodules file.
  2. Stage the .gitmodules changes git add .gitmodules
  3. Delete the relevant section from .git/config.
  4. Run git rm --cached path_to_submodule (no trailing slash).
  5. Run rm -rf .git/modules/path_to_submodule
  6. Commit git commit -m "Removed submodule {name}"
  7. Delete the now untracked submodule files
  8. rm -rf path_to_submodule

See also

Favorite site