Created
August 17, 2009 21:38
-
-
Save aanand/169393 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -o errexit | |
BRANCH=$(git branch | grep '*' | awk '{ print $2; }') | |
git fetch | |
for branch in $(ls .git/refs/heads) | |
do | |
if [ -f .git/refs/remotes/origin/$branch ] | |
then | |
if git diff --quiet $branch remotes/origin/$branch | |
then | |
echo "$branch is up-to-date." | |
else | |
git checkout $branch | |
git rebase origin/$branch | |
fi | |
fi | |
done | |
git checkout $BRANCH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment