Skip to content

Instantly share code, notes, and snippets.

@traviskroberts
Last active December 25, 2015 09:09
Show Gist options
  • Save traviskroberts/6952241 to your computer and use it in GitHub Desktop.
Save traviskroberts/6952241 to your computer and use it in GitHub Desktop.
#!/bin/sh
CURRENT=`git branch | grep '\*' | awk '{print $2}'`
TARGET=$1
: ${TARGET:="master"}
echo "\033[33m=> git checkout ${TARGET}\033[0m"
git checkout ${TARGET}
echo "\033[33m=> git pull origin ${TARGET}\033[0m"
git pull origin ${TARGET}
echo "\033[33m=> git checkout ${CURRENT}\033[0m"
git checkout ${CURRENT}
echo "\033[33m=> git rebase ${TARGET}\033[0m"
git rebase ${TARGET}
#!/bin/sh
CURRENT=`git branch | grep '\*' | awk '{print $2}'`
TARGET=$1
: ${TARGET:="master"}
echo "\033[33m=> git checkout ${TARGET}\033[0m"
git checkout ${TARGET}
echo "\033[33m=> git merge ${CURRENT}\033[0m"
git merge ${CURRENT}
echo "\033[33m=> git push origin ${TARGET}\033[0m"
git push origin ${TARGET}
echo "\033[33m=> git checkout ${CURRENT}\033[0m"
git checkout ${CURRENT}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment