Last active
December 11, 2015 21:09
-
-
Save derek/4660453 to your computer and use it in GitHub Desktop.
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 | |
function sync() { | |
BRANCH=$(parse_git_branch) | |
git fetch --all; | |
git checkout master && git merge upstream/master; | |
git checkout dev-master && git merge upstream/dev-master; | |
git checkout 3.x && git merge upstream/3.x; | |
git checkout dev-3.x && git merge upstream/dev-3.x; | |
git checkout live-docs && git merge upstream/live-docs; | |
git push --mirror origin; | |
git push --mirror origin; | |
git checkout $BRANCH; | |
} | |
function parse_git_branch (){ | |
if git rev-parse --git-dir >/dev/null 2>&1 | |
then | |
gitver=$(git branch 2>/dev/null| sed -n '/^\*/s/^\* //p') | |
else | |
return 0 | |
fi | |
echo $gitver | |
} | |
sync |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment