Skip to content

Instantly share code, notes, and snippets.

@kaiohken1982
Created December 28, 2011 05:47
Show Gist options
  • Save kaiohken1982/1526601 to your computer and use it in GitHub Desktop.
Save kaiohken1982/1526601 to your computer and use it in GitHub Desktop.
Git, how to update a submodule
# 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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment