• Scientific Computing | SciVision

  • Blog
  • Tags
  • Categories

diff and patch disregard line endings Dos Unix

26 July, 2016

For Git repos, avoid the line-ending problem between Windows and Mac/Linux/BSD via .gitattributes file.

Otherwise, to disregard line endings for diff and patch:

diff -Naur --strip-trailing-cr old.txt new.txt
  • shell