3

When I pull from remote branch, Git automatically removes all the trailing-space and it masses up my git diff (showing line deleting and adding). Also I'm using Atom editor so I'm not too sure where the problem came from.

How can I disable trimming the trailing-space? Thanks in advance!

wayneiny
  • 141
  • 1
  • 8
  • Use `git diff -w`. –  May 13 '16 at 18:51
  • It looks like this has turned out to be a duplicate of [Github atom editor shows line deleted and added back](http://stackoverflow.com/questions/34896982/github-atom-editor-shows-line-deleted-and-added-back/34897198) – Richard Slater May 13 '16 at 19:44
  • Yeah. I found my answer in one of the atom discussions. Thanks – wayneiny May 19 '16 at 19:56

1 Answers1

3

Usually the problem with git is that it doesn't automatically remove trailing whitespace leading to excessive conflicts when the diffs only have whitespace differences. See this SO Question (among many).

However, I did find some discussion GitHub about Atom settings with respect to leaving trailing whitespace (or not). So I would look to the Atom setting first for your solution (e.g., here).

Community
  • 1
  • 1
WPrecht
  • 1,340
  • 1
  • 17
  • 29