Created
April 13, 2018 21:35
-
-
Save sbilstein/1e7dc6f16f057b5f4f56fc2a3fd7698a to your computer and use it in GitHub Desktop.
remaster
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/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