0

When I git pull from our development server for a specific file, I get conflicted again and again even after removing that file from the development server. It will show the conflict in the next pull again. I did checkout that specific file but still it show conflict in next pull.

I have tried to delete this file but in next pull it shows the conflict for the same file. I don't want to keep the content just want to remove local changes and take the pull. How to resolve this conflict?

Daniel
  • 2,355
  • 9
  • 23
  • 30
Mithilesh Jha
  • 175
  • 1
  • 11
  • 2
    Possible duplicate of [Throw away local commits in git](https://stackoverflow.com/questions/5097456/throw-away-local-commits-in-git) – Danon Aug 28 '18 at 13:57

2 Answers2

0

Assuming that master is the local branch you're replacing, and that "origin/master" is the remote branch you want to reset to:

 git reset --hard origin/master

This will remove all local changes and pull it again from remote master

Nisarg
  • 1,631
  • 6
  • 19
  • 31
0

Well, you could just discard your local changes and do this

git fetch --all
git reset origin/master --hard

but why would you want to discard your local changes? Maybe you could just do

git pull

and then look for conflicted files, solve the conflicts - as described here Resolving a merge conflict - and then commit and push your changes.

git commit -m "Merged"
git push
Danon
  • 2,771
  • 27
  • 37