ajax333221
ajax333221

Reputation: 11774

Github is not showing the differences of my commits correctly

I submitted a commit with some fixes here and there, but github is not correctly showing the differences (e.g this line removed, this one added, etc). It just shows two big walls of code, one red (removed code) and one green (added code).

This is not the first time it happen to me, and this last time I was extra careful to not mess with any other parts of my code. I must be doing something wrong, every free online tool I have tried shows the text differences easily.

How can I prevent this from happening again?

Note: in case it matters, I am using Windows and submitting them via their downloadable thingy.

Upvotes: 1

Views: 191

Answers (1)

nulltoken
nulltoken

Reputation: 67669

This looks like the standard Git on Windows line ending related issue ;-)

Running the following command in the bash command line interface should fix your problem.

$ git config --global core.autocrlf true

See this GitHub help page for more information about this subject.

Upvotes: 4

Related Questions