Skip to content

Instantly share code, notes, and snippets.

@AndrewRussellHayes
Last active December 28, 2015 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndrewRussellHayes/7548439 to your computer and use it in GitHub Desktop.
Save AndrewRussellHayes/7548439 to your computer and use it in GitHub Desktop.
update submodule to their current head status in git
# get the submodule initially
git submodule add ssh://bla submodule_dir
git submodule init
# time passes, submodule upstream is updated
# and you now want to update
# change to the submodule directory
cd submodule_dir
# checkout desired branch
git checkout master
# update
git pull
# get back to your project root
cd ..
# now the submodules are in the state you want, so
git commit -am "Pulled down update to submodule_dir"
Or, if you're a quite busy person:
git submodule foreach git pull origin master
Or, for a recursive version
git submodule foreach --recursive git pull
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment