Skip to content

Instantly share code, notes, and snippets.

@ninjapanzer
Created September 1, 2015 01:42
Show Gist options
  • Select an option

  • Save ninjapanzer/6e1422ff471f32c6a4b5 to your computer and use it in GitHub Desktop.

Select an option

Save ninjapanzer/6e1422ff471f32c6a4b5 to your computer and use it in GitHub Desktop.
One way force push to reset github fork
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