Skip to content

Instantly share code, notes, and snippets.

@johngorithm
Last active January 22, 2020 18:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johngorithm/a7c8efe217e1a0b2bfcd0e915a595cd1 to your computer and use it in GitHub Desktop.
Save johngorithm/a7c8efe217e1a0b2bfcd0e915a595cd1 to your computer and use it in GitHub Desktop.

First

git fetch --all

Next

git reset --hard origin/<feature-branch>
Explanation:

git fetch downloads the latest from remote without trying to merge or rebase anything.

Then the git reset resets the master branch to what you just fetched. The --hard option changes all the files in your working tree to match the files in origin/master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment