Skip to content

Instantly share code, notes, and snippets.

@palashmon
Last active September 7, 2017 17:15
Show Gist options
  • Save palashmon/d3fcd6b560b7bc9752ed62252f38287a to your computer and use it in GitHub Desktop.
Save palashmon/d3fcd6b560b7bc9752ed62252f38287a to your computer and use it in GitHub Desktop.
Make your forked repo master to be the same as upstream/master

Purpose

This is mainly used to make your git forked repo master same as upstream/master(user repo that you have forked orginally from) and ignore all you local commits to master. This might be needed in cases where you have pushed your local changes to master instead of a new branch, by mistake.

Usage

git fetch upstream
git reset --hard upstream/master
git push origin master --force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment