问题
After doing git difftool --dir-diff
, my workspace files are modified for some reason. I've been guessing that it's converting the line endings between crlf
and lf
etc... However, doing "git config core.autocrlf false
" or "git config --global core.autocrlf false
" don't make any difference. I have tried using both windiff and beyond compare as the custom diff tool but it doesn't help. This is bad since every time I view some changes in my .csproj file, the project is reloaded since it said the file has been modified externally. Any ideas?
回答1:
The only other way an automatic conversion can be declared is through .gitattributes file (see gitattributes):
- with directives like
*.txt eol=lf
("Git: Default all text files to unix line breaks") or* text=auto
("Force LF eol in git repo and working copy") - with content filter (smudge script)
来源:https://stackoverflow.com/questions/12701429/after-doing-a-git-difftool-dir-diff-files-are-modified-for-some-reason