Reputation: 17476
I want git to forget everything that I have edited in local branch, and want to pull the update from remote branch.
I did not know how to do that and I am getting merge conflicts on few files.
What should I do if I do not want to merge the files at all (local edits need to be deleted) and start new with the remote HEAD?
Upvotes: 2
Views: 344
Reputation: 1323135
Supposing you are talking about changes done on master
branch for instance:
git checkout master
git reset --hard origin/master
git pull
You reset master
HEAD
on the one of remote/master
, and then can fetch remote/master
+ merge it to local master
.
Upvotes: 6
Reputation: 39560
Why don't you just delete your local copy, and reclone the remote? That's effectively like deleting all your changes, without having to have local history for unwanted changes.
Upvotes: 0