Created
August 7, 2012 08:27
-
-
Save orimanabu/3283179 to your computer and use it in GitHub Desktop.
postgres repo sync script among mainline and local and personal github
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/sh | |
current_branch=$(git branch | grep '^\*' | sed -e 's/^\* //') | |
echo "==> checking current branch: ${current_branch}" | |
if [ x"${current_branch}" != x"master" ]; then | |
echo "current branch is not 'master'." | |
echo "===> checking out master..." | |
git checkout master | |
if [ x"$?" != x"0" ]; then | |
echo "checking out master failed." | |
echo "exit." | |
exit 1 | |
fi | |
fi | |
echo "==> pulling from github original repo..." | |
git pull [email protected]:postgres/postgres.git master | |
echo "==> pushing to github personal repo..." | |
git push | |
echo "==> finish: changing back to working branch: ${current_branch}" | |
git checkout ${current_branch} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment