There are so many posts but still the resolution is not clear or isn't working for me. Problem seems to be well known..
I checked out my project in unix and git status shows no differences. Settings here:
bash-3.2$ git config core.autocrlf
false
bash-3.2$ git config core.whitespace
cr-at-eol
But I also like to use SourceTree (pointing to the same Unix code base through NFS mount) for some conveniences.
Settings for those above attributes are exactly same.
But SourceTree shows a bunch of differences in based on purely line endings.
What is the straightforward solution for this?
How come SourceTree has no settings in the UI around this?
There is a gear icon
near the diff-ui section of the SourceTree app that show your file difference, you can click on it and set it to show whitespace
or ignore whitespace
!! I googled for hours, and finally got the answer after searching for SourceTree equivalent of the git command:
Git version <= 1.8.3.4:
git diff --ignore-space-at-eol -b -w [commit] ...
Git version >= 1.8.4:
git diff --ignore-space-at-eol -b -w --ignore-blank-lines [commit] ...
See the options definition below:
--ignore-space-at-eol
Ignore changes in whitespace at EOL.
-b
--ignore-space-change
Ignore changes in amount of whitespace. This ignores whitespace at line end,
and considers all other sequences of one or more whitespace characters to be
equivalent.
-w
--ignore-all-space
Ignore whitespace when comparing lines. This ignores differences even if one
line has whitespace where the other line has none.
[git version 1.8.4+]--ignore-blank-lines
Ignore changes whose lines are all blank.
References:
The git command equivalent
Source Tree app settings
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With