4

I have a git clone which is messed up with added new files, deleted files and both modified Files. I need a way to clean this up in a time saving manner.

Because of the conflicts in origin, When I pull the upstream it gives more than 2000 conficts. Can anyone tell me how to clean my origin and get the origin upto date with upstream ?

Chamalee De Silva
  • 687
  • 1
  • 9
  • 28

1 Answers1

5

You could simply reset your own branch to the one from origin

git fetch origin
git reset --hard origin/aBranch

That would remove any local commit and local modification from the working tree, and reset everything to what is fetched from the upstream repo.

If "origin" and "upstream" differ, you would need to "git push --force" one to the other (make sure the other collaborators are aware of that push).

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250