Git Submodule command line sample
Submodule Data Source: http://blog.jacius.info/git-submodule-cheat-sheet/ Recipes Note: the [main]$ bits on each line represents your bash prompt. You should only type the stuff after the $. Set up the submodule for the first time: [ ~ ] $ cd ~/main/ [ main ] $ git submodule add git://github.com/my/submodule.git ./subm [ main ] $ git submodule update --init [ main ] $ git commit ./submodule -m "Added submodule as ./subm" Fetch submodules after cloning a repository: [ ~ ] $ git clone git://github.com/my/main.git ~/main [ ~ ] $ cd ~/main/ [ main ] $ git submodule update --init Pull upstream main repo changes and update submodule contents: [ main ] $ git pull origin/master [ main ] $ git submodule update Pull upstream changes to the submodule: [ main ] $ cd./subm [ subm ] $ git pull origin/master # or fetch then merge [ subm ] $ cd .. [ main ] $ git commit ./subm -m "Updated submodule reference" ...