Diffs Do Not Render Correctly Due to An Old Style Mac Line Endings
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Problem
Diffs do not render correctly in SourceTree due to an old style Mac line Endings (CR).
Cause
Prior to Mac OS X, the Mac used the CR character to end lines. However, both Git and Mercurial do not recognise CR as a line ending and will display diffs entirely on one line if you use them.
Resolution
Use Unix LF line endings for your text files in OS X. It's been the standard for quite a while now and both git and hg understand them and SourceTree will display the diffs correctly. You can still version files with CR line endings, but the diffs will never be very readable so it's advisable to avoid it.
SourceTree does support Windows-style CR/LF endings too, because these are also supported in Mercurial and Git.
Was this helpful?