0

My file had a newline, inserted from a Windows machine into the git repo. Screenshot :-enter image description here

Notice the New Line between the brackets. This was from a Windows machine. The last bracket is end-of-class bracket, and other one is end-of-function bracket

Now, another user from a Ubuntu Linux Machine, removed this new line and added a new method in the end.

The code till the second-last bracket, was also present in the target branch. The Linux user, added the code below it, and automerge was supposed to merge only the new code (or throw a conflict).

Git auto merge ran, without throwing a conflict, but automerged, and redundantly copied and pasted a few lines of code, including the second-last bracket.

What could be a potential cause of this? Let me know if any additional details is need or not.

Krishna
  • 484
  • 7
  • 22
user3279692
  • 329
  • 2
  • 13
  • Possible duplicate of [git replacing LF with CRLF](https://stackoverflow.com/questions/1967370/git-replacing-lf-with-crlf) – Krishna Mar 13 '19 at 18:59
  • @Krishna but it did not show any warning of any sorts ? I am running git 2.17 – user3279692 Mar 13 '19 at 19:02
  • If the linux user pulled the latest changes and pushed his new section of code to the same branch then it will not create a conflict. If you can provide the diff with the 2 scenarios it will be better to understand. – Krishna Mar 13 '19 at 19:13
  • 1
    From what you've posted here, we cannot tell what the problem was. – torek Mar 13 '19 at 20:35

0 Answers0