Skip to content

Instantly share code, notes, and snippets.

@richmilns
Created February 28, 2015 00:09
Show Gist options
  • Save richmilns/1dcdfe2d55bee32d80cf to your computer and use it in GitHub Desktop.
Save richmilns/1dcdfe2d55bee32d80cf to your computer and use it in GitHub Desktop.
Useful Git commands
# clone including submodules
git clone --recursive [email protected]:repo.git
# pull changes and update all submodules
git pull && git submodule foreach git pull origin master && git submodule update --recursive
# pull changes for every submodule
git submodule foreach git pull origin master
# when adding a new submodule after repo has been cloned, you need to re-init all submodules to make sure the code is actually checkout out
git submodule update --init --recursive
# update tags
git fetch --tags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment