Git submodule notes
How to add a new git submodule¶
$ cd /home/saltycrane/path/to/main/project
$ mkdir -p lib
$ git submodule add [email protected]:saltycrane/another-project.git lib/another-project
$ git commit -m 'Add another-project git submodule'
Reference¶
http://chrisjean.com/2009/04/20/git-submodules-adding-using-removing-and-updating/
How to remove a git submodule¶
Via Stack Overflow via Git Submodule Tutorial.
Delete the relevant section from the .gitmodules file. Delete the relevant section from .git/config. Run git rm --cached path_to_submodule (no trailing slash). Commit Delete the now untracked submodule files rm -rf path_to_submodule
Related posts
- git worktree notes — posted 2017-05-27
- Converting an hg repository to git — posted 2014-12-03
- Example using git bisect to narrow in on a commit — posted 2011-08-13
- git notes — posted 2011-08-11
- Colorized, interactive "git blame" in Emacs: vc-annotate — posted 2011-05-28