Last Updated: February 25, 2016
·
1.433K
· bainternet

Painless git submodules update

Another one of my favorite git alias is use to update submodules in git which without you would have to do something like this:

cd submodule_name
git checkout master
git pull
git submodule update --init --recursive
cd ..

for each submodule!
But once you run this :

git config --global alias.sub-it-up "!update_subs() { git submodule foreach 'git fetch origin --tags; git checkout master; git pull' && git pull && git submodule update --init --recursive;}; update_subs"

You'll be able to update all submodules with:

git sub-it-up