Adding Submodules
git submodule add git@mygithost:billboard lib/billboard
Using Submodules
git submodule init
git submodule update
Removing Submodules
No build-in way.
- Remove lines in
.gitmodules
[submodule “lib/billboard”]
path = lib/billboard
url = git@mygithost:billboard
- Remove entry in the
.git/config
[submodule “billboard”]
url = git@mygithost:billboard
- Remove paths created by the submodule
git rm --cached lib/billboard
Updating Submodules
git submodule init
git submodule update
ref: https://chrisjean.com/git-submodules-adding-using-removing-and-updating/
Renaming Submodules
After git 1.8.5:
git mv A B
ref: https://stackoverflow.com/questions/4526910/rename-a-git-submodule