1

We are two people working on a git repository. Almost every time my colleague pushes stuff to the repository, when I pull them in my local repo, a lot of files that I have never touched (or even opened for that matter) become conflicted.

Can anyone suggest a way to investigate it?

2
  • maybe everytime he's using this, git add src/ , I'm not sure , but I think I had this problem once
    – The Coder
    Feb 7, 2015 at 8:28
  • 1
    Are you both working on the master branch? Do you have other branches? Has either of you rebased or amended changes that have been pushed?
    – halfer
    Feb 7, 2015 at 8:29

2 Answers 2

2

Check the exact nature of the diff: it might involve eol (end of line) style (\n\r vs \n)

git diff --word-diff-regex=.

In that case, make sure your:

  • git config --global core.autocrlf is set to false
  • your editor respect eol style and don't attempt to change it.
4
1

One way to try fixing this problem is for both of you to clone the repo to a different local folder, and then committing in a test change each. If you both push and pull and it is OK, it may be that one of you tried to rewrite history by rebaseing or amending pushed commit(s).

If those test commits work, you can commit and push any pending changes each of you have, and point your editor to the new repo. I tend to recommend not deleting your old one for a few days, in case there is a change you forget to copy!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.