Update all of your GIT repo with one line

I have so many GIT repo that I wanted to be able to update them all, easily. With just a one line command I could alias.

Simple version could be like this :

find . -type d -maxdepth 1 -name "??*" -exec sh -c "cd '{}' && git pull; cd ..  " \;

The idea is simple, it parse every folder down your current one, and execute `git  pull` inside, then continue to the next folder.

I'm lazy ... I certainly don't want to type this long command every time, so I added an alias. Add this line to your .bash_profile (or .bashrc whatever).

This is a little bit more complex version which avoid digging into .git folder and write useful feedback on your terminal screen.

alias gla='find . -type d -maxdepth 4 -not -path "*/.git*" -name "??*"  -exec bash -c "cd \"{}\"; [ -d .git ] && ( echo ------------ Updating {} ; git pull --all) ; cd .. ; " \;'

Reload your profile :

source ~/.bash_profile