源树将所有文件标记为已修改 [英] source tree marks all file as modified
问题描述
我开始使用sourceTree
当我更改某些文件时遇到问题,我注意到这些文件来自我的视图文件夹(MVC),sourceTree将其标记为:
修改过的文件,更改了1行,删除了1行
当我将它压入我的svn时,整个文件被标记为已更改,如下所示:
我的更改之前的所有代码都标记为' - '
然后我的更改之后的所有代码都标以'+'(也是我没有碰到的东西)
任何解决方案?
确保config core.autocrlf
被设置为false,以避免在所有文件中自动进行eol(行尾)转换。
git config --global core.autocrlf false
(并将您的repo克隆到看看问题是否仍然存在)
更多信息,请参阅 SourceTree应用程序说未提交的更改即使是新的c loned存储库 - 什么可能是错误的?
这个sourceTree线程也指向 .gitattributes
文件。
OP Asaf Maoz 指向另一个来源(在评论中),仍然与eol相关:
问题出在我的 IDE行结尾设置,一些文件行结尾被设置为MAC(当我不在MAC上时)并且ST无法正确转换它们。
I started using sourceTree I have a problem when I change certain files, I noticed those are files from my views folder (MVC), sourceTree marks it as:
Modified file, 1 lines changed, 1 lines removed
and when I push it to my svn the whole file is marked as changed, as in: All the code from before my changes marked with '-' And then all the code from after my changes marked with '+' (also stuff I didnt touch)
Any solutions?
Make sure that the config core.autocrlf
is set to false, to avoid automatic eol (end of lines) conversion on all your files.
git config --global core.autocrlf false
(and re-clone your repo to see if the issue persists)
See for more "SourceTree App says uncommitted changes even for newly-cloned repository - what could be wrong?"
This sourceTree thread points out also to .gitattributes
files.
The OP Asaf Maoz points to another source (in the comments), still related to eol:
the problem was in my IDE line endings settings, some files line endings was set to MAC (when I am not on MAC) and ST could not convert them properly.
这篇关于源树将所有文件标记为已修改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!