Friday, November 27, 2015

Abandon git local branch

I've merged, I've commited changes locally, but I have not decided to push it or not, so I leave it there. After several days, I want to totally abandon my local branch.

I would do below:

  1. git checkout master
    It will just tell you that your local branch is different from remote.
  2. git reset --hard origin/master
    This is the real effect command, it will force your local to be exactly same as remote.

No comments: