Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
remaster
#!/bin/sh
branch=`git branch | grep \* | cut -d ' ' -f2`
if [ $branch = 'master' ]; then
echo "Can't remaster on master" >&2
exit 1
fi
ref=`git rev-parse $branch`
echo "To restore your branch ($branch), run the following:"
echo " git checkout $ref"
git checkout master
git pull
git checkout $branch
git rebase -i master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.