0

I am very new with git and repositorys and I have a problem. Me and my collegue were working on the same file.

  1. He commited and pushed his changes.
  2. I commited my changes
  3. I pulled

Now I have conflicts and I want to solve them. How can I overwrite the conflicts so that my changes are on the file? I am working with Eclipse.

dotvav
  • 2,808
  • 15
  • 31
marcmaann
  • 151
  • 1
  • 3
  • 12
  • 1
    possible duplicate of [Fix merge conflicts in Git?](http://stackoverflow.com/questions/161813/fix-merge-conflicts-in-git) – dotvav Aug 14 '15 at 08:50

2 Answers2

0

There is no easy way to resolve conflicts. But tools are available to make the process a little easier. Anyhow you will have to decide and manually make the changes so that both of your changes are available in the latest file.

Try: git mergetool

If you both edited separate parts of the file then the tool will automatically merge whereas if you both have edited the same part then some manual interaction is needed.

DesirePRG
  • 6,122
  • 15
  • 69
  • 114
0

If you want Your changes you can use:

git fetch -p
git merge --ours

This will merge the remote with your local branches and in case of any conflict - use your version of code.

Zloj
  • 2,235
  • 2
  • 18
  • 28