end*_*ess 9 git line-endings atlassian-sourcetree
有这么多帖子,但仍然没有明确或不适合我的决议.问题似乎众所周知..
我在unix中检查了我的项目,git状态显示没有差异.设置在这里:
bash-3.2$ git config core.autocrlf
false
bash-3.2$ git config core.whitespace
cr-at-eol
Run Code Online (Sandbox Code Playgroud)但我也喜欢使用SourceTree(通过NFS挂载指向相同的Unix代码库)以获得一些便利.上述属性的设置完全相同.
但SourceTree基于纯粹的行结尾显示了一系列差异.
什么是直截了当的解决方案?
为什么SourceTree在这个UI中没有设置?
还有就是gear icon附近的SourceTree应用程序,显示您的文件差异的DIFF-UI部分,您可以点击它并将其设置为show whitespace或ignore whitespace!! 我用Google搜索了几个小时,最后在搜索SourceTree等效的git命令后得到了答案:
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.
Run Code Online (Sandbox Code Playgroud)
参考文献:
|   归档时间:  |  
           
  |  
        
|   查看次数:  |  
           2851 次  |  
        
|   最近记录:  |