Created
September 1, 2015 01:42
-
-
Save ninjapanzer/6e1422ff471f32c6a4b5 to your computer and use it in GitHub Desktop.
One way force push to reset github fork
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
| SOURCE_BRANCH=`git rev-parse --abbrev-ref HEAD` | |
| syncBranch(){ | |
| echo "Syncing to $1 $2" | |
| DEST_BRANCH=$1 | |
| DEST_REMOTE=$2 | |
| git checkout $DEST_BRANCH | |
| # Make sure we actually made it to the destination branch | |
| if [ `git rev-parse --abbrev-ref HEAD` != $DEST_BRANCH ]; then | |
| echo "!!!! Something went wrong check the errors above and try again !!!!" | |
| exit 0 | |
| fi | |
| git push $DEST_REMOTE $DEST_BRANCH --force | |
| } | |
| syncBranch master wcccedu | |
| syncBranch gh-pages wcccedu | |
| git checkout $SOURCE_BRANCH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment