2

I'm looking at a commit (in Bitbucket) and for a given file which is, let's say, 100 lines I see that there are 100 lines removed, and 100 lines added. The content of the lines removed and the lines added are identical down to the indentation and spacing.

Under what circumstances can what I just described occur?

rdgd
  • 1,451
  • 2
  • 18
  • 33

1 Answers1

2

To check if this is an end of line issue, try:

git config --global core.autocrlf false
git clone https://bitbucket.org/user/repo newLocalClone
cd newLocalClone
git status

(while there are cases where core.autocrlf can help, I prefer setting it to false and working with .gitattributes core.eol directives)

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 1
    I agree with you VonC, but on the other hand I am a big opponent for this particular git feature. IMHO line endings is not something your VCS should take care of it. I personally think you as a developer and you as team should take care of it. E.g one could configure the IDE to use a common line ending. For me personally this is policy I declare when I work with other team mates. Just an addition to your answer, anyway you get +1. – ckruczek Aug 27 '15 at 06:38
  • 1
    @ckruczek " line endings is not something your VCS should take care of it": I agree, and that is why I set this global config to false. The `core.eol` in `.gitattributes` have always been enough for me. – VonC Aug 27 '15 at 06:40
  • 1
    Yep, agreed on that. I just had a the experience with some tools like egit, which where not capable of handling the `.gitattributes`, in particular the `core.eol` etc, correctly which resulted in biiiiigggg errors and bugs. – ckruczek Aug 27 '15 at 06:42
  • 1
    @ckruczek good point. I just saw https://bugs.eclipse.org/bugs/show_bug.cgi?id=342372#c42 yesterday... this doesn't look promising. – VonC Aug 27 '15 at 06:45
  • 1
    Yes exactly this is what I mean. For a software developer this is actually [unacceptable](https://importantshock.files.wordpress.com/2008/08/unacceptable.png?w=455&h=562)... Thx for the positive discussion ;) – ckruczek Aug 27 '15 at 06:49
  • Thank you all for the answer, the links, and good discussion. Much appreciated. – rdgd Aug 28 '15 at 17:05