Skip to content

Instantly share code, notes, and snippets.

@pasrom
Last active May 8, 2018 06:05
Show Gist options
  • Save pasrom/722e03c6995f60504d9c75d3141725ce to your computer and use it in GitHub Desktop.
Save pasrom/722e03c6995f60504d9c75d3141725ce to your computer and use it in GitHub Desktop.
Git Commands
git submodule add https://gist.github.com/0965be641547b34618926d404773cd94.git InkscapeConverter
git submodule init
git submodule update

If you run git submodule update --remote, Git will go into your submodules and fetch and update for you.

git submodule update --remote InkscapeConverter

Source

# 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 busy person:

git submodule foreach git pull origin master

Source

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment