Skip to content

Instantly share code, notes, and snippets.

@ecarreras
Created January 8, 2014 08:47
Show Gist options
  • Save ecarreras/8313732 to your computer and use it in GitHub Desktop.
Save ecarreras/8313732 to your computer and use it in GitHub Desktop.
#!/bin/bash
for d in `ls -1 ~/src`; do
if [ -d ~/src/$d/.git ]; then
pushd ~/src/$d &>/dev/null
branch=$(git branch | grep '^*' | cut -d ' ' -f 2)
echo "Updating $d ($branch) ..."
git fetch
git merge origin/$branch
popd &>/dev/null
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment