windows Egit 将所有文件显示为已更改
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8521445/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Egit shows all files as changed
提问by BetaRide
I'm working with Git on my Windows 7 PC on the command line and with TortoiseGit. This works fine. Now I've installed EGit for Eclipse. EGit is showing all files as changed although git status correctly reports, that there are no changes.
我正在 Windows 7 PC 上的命令行和 TortoiseGit 上使用 Git。这工作正常。现在我已经为 Eclipse 安装了 EGit。尽管 git status 正确报告没有更改,但 EGit 将所有文件显示为已更改。
Any idea what's wrong?
知道出了什么问题吗?
回答by Lavanya
I also had the similar issue, I have changed the below property of repository setting under Git configuration in eclipse
我也有类似的问题,我在 eclipse 中的 Git 配置下更改了存储库设置的以下属性
autocrlf = false
autocrlf = 假
This fixed the problem
这解决了问题
You can get more details from the below link too:
您也可以从以下链接获取更多详细信息:
There is nothing changed, but eclipse egit marks the file as changed
没有任何变化,但 eclipse egit 将文件标记为已更改
Basically I added this property as true in order to address ctrl+M chars in script files. Now I am not sure how to address this issue. Any thought on this, please share.
基本上我将此属性添加为 true 以解决脚本文件中的 ctrl+M 字符。现在我不确定如何解决这个问题。对此有任何想法,请分享。
回答by Pyrce
This is a late response, but I recently ran into this same problem when initially cloning a git repository. EGit was showing all files as changed even though it had just been cloned and git bash showed no changes in the files.
这是一个迟到的回应,但我最近在最初克隆 git 存储库时遇到了同样的问题。EGit 显示所有文件都已更改,即使它刚刚被克隆并且 git bash 显示文件中没有任何更改。
Since you usually don't want autocrlf = false on Windows machines, I left autocrlf = true and cloned the repository. Then in EGit I commited the faux changes to all files and finally in git bash reverted to the previous commit with git reset --hard HEAD^1
. This tricked EGit into thinking the line endings were correct without needing to touch the actual repository. Commits and pulls after this point haven't reproduced the EGit confusion in my configuration. Additionally no unexpected line ending changes occur when I push to the repository.
由于您通常不希望在 Windows 机器上使用 autocrlf = false,因此我保留了 autocrlf = true 并克隆了存储库。然后在 EGit 中我提交了对所有文件的虚假更改,最后在 git bash 中使用git reset --hard HEAD^1
. 这让 EGit 认为行尾是正确的,而无需接触实际的存储库。在这一点之后提交和拉取并没有在我的配置中重现 EGit 混乱。此外,当我推送到存储库时,不会发生意外的行结束更改。
回答by 11101101b
I was never able to get any of the suggested solutions to work. I ended-up fixing the issue by re-cloning the repository with the Windows installed Git Bash (I had cloned using Git within Cygwin previously).
我永远无法让任何建议的解决方案起作用。我最终通过使用 Windows 安装的 Git Bash 重新克隆存储库来解决这个问题(我之前在 Cygwin 中使用 Git 进行了克隆)。
I'm posting this as another answer just in case someone else is in the same boat as me.
我将此作为另一个答案发布,以防万一其他人与我在同一条船上。
回答by rash.m2k
I was also having this issue and it was driving me crazy! It kepts saying 'Checkout conflicts with file:'
我也遇到了这个问题,这让我发疯了!它一直说“结帐与文件冲突:”
Anyway I managed to (kind of) fix this using a combination of the following:
无论如何,我设法(有点)使用以下组合来解决这个问题:
Team -> Advanced -> Assumed Unchanged on the resource causing the conflict
团队 -> 高级 -> 假设在导致冲突的资源上未更改
Then change core.autocrlf to false and also set core.whitespace to empty string.
然后将 core.autocrlf 更改为 false 并将 core.whitespace 设置为空字符串。
This works fine for .java files but .xml files and .xsd files are still causing this issue!
这适用于 .java 文件,但 .xml 文件和 .xsd 文件仍然导致此问题!