Skip to content

Instantly share code, notes, and snippets.

@pablo-sg-pacheco
Last active August 23, 2016 19:34
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 pablo-sg-pacheco/0277e8b584f7d05405d569af4f09dced to your computer and use it in GitHub Desktop.
Save pablo-sg-pacheco/0277e8b584f7d05405d569af4f09dced to your computer and use it in GitHub Desktop.
GIT - submodules
#COMMIT AND PUSH ALL SUBMODULES
#In Main project
git submodule foreach 'git add .' #recursively add files in submodules
git submodule foreach 'git commit -a -m "Altered submodule" || :'
git add --all :/
git commit -am "Altered submodule"
git push --recurse-submodules=on-demand
#UPDATES ALL SUBMODULES
#In Main project
#If its the first time:
git submodule update --init --recursive
#If not
git submodule foreach git pull origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment