-
-
Save rud/106620 to your computer and use it in GitHub Desktop.
git hack command, see http://object.io/site/2010/12/hack-and-ship/
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 -x | |
# Exit if any error is encountered: | |
set -o errexit | |
# git name-rev is fail | |
CURRENT=`git branch | grep '\*' | awk '{print $2}'` | |
git checkout master | |
git pull --rebase origin master | |
git checkout ${CURRENT} | |
git rebase master |
Hi joefiorini,
Thank you for the tip, I've updated the gist as suggested. Much cleaner that way. Aah, proper error handling.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use
set -e
at the top of your script and clean up the|| exit 1
s at the end of each line.