Created
December 11, 2012 09:59
-
-
Save paulbellamy/4257437 to your computer and use it in GitHub Desktop.
git-sync
This file contains 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 | |
current_branch=`git rev-parse --abbrev-ref HEAD` | |
if [ "$1" != "" ] && [ "$current_branch" != "$1" ]; then | |
# not syncing current branch | |
git fetch upstream && git push `whoami` upstream/$1:$1 | |
else | |
git pull upstream $current_branch && git push -u `whoami` $current_branch | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment