简体   繁体   English

Git报告Windows 8上已更改的文件

[英]Git reports changed files on Windows 8

I have been struggling with this git problem. 我一直在努力解决这个git问题。

The problem is that when I do a fresh clone from GitHub, git reports that some files has changed although I have not touched them. 问题是,当我从GitHub进行全新克隆时,git报告一些文件已更改,尽管我没有碰过。

Often this happens when I switch branches as well. 当我也切换分支时,通常会发生这种情况。 If I go from an unmodified master to another branch and back to master, it says files has been changed in master. 如果我从一个未修改的master转到另一个分支,然后再回到master,则表示文件在master中已更改。

I have been reading about line endings and tried just about everything in that category, but nothing seems to help. 我一直在阅读有关行尾的内容,并尝试了该类别中的所有内容,但似乎无济于事。

The repository is https://github.com/seesharper/LightInject is case someone would like to try and see if they have the same problem. 仓库是https://github.com/seesharper/LightInject ,以防有人要尝试看看他们是否有同样的问题。

A friend of mine had the exact same problem with the same repository on his Windows 8 machine. 我的一个朋友在Windows 8计算机上使用相同的存储库时遇到了完全相同的问题。 Then he tried it on Windows 7 and the problem went away. 然后他在Windows 7上进行了尝试,问题消失了。

Does anybody know of any issues with using git on windows 8. 是否有人知道在Windows 8上使用git有任何问题。

I have also tried this on another Windows 8 machine and it has the same problem. 我也在另一台Windows 8计算机上尝试过此操作,它也存在相同的问题。

I experienced the same issue with Windows 7. This is something I did to resolve (you might try): 我在Windows 7中遇到了相同的问题。这是我要解决的问题(您可以尝试):

git clone git@github.com:seesharper/LightInject.git
cd LightInject
git status
git checkout -f -b mine HEAD~
git status
git checkout master
git status
git branch -D mine

I've dealt with this issue in the past - keep in mind that most git installations run on non-windows servers. 我过去处理过这个问题-请记住,大多数git安装都在非Windows服务器上运行。 There's a distinct possibility that what Windows is seeing is actually something where the "filemode" of the file is different than what Linux expects, therefore it sees the file as changed. Windows看到的实际上是文件的“文件模式”与Linux期望的不同的可能性,因此它认为文件已更改。

Poking around on the internet, there may be a way to fix the filemode issue - but nothing on google is jogging my memory at the moment. 在互联网上闲逛,也许有一种方法可以解决文件模式问题-但Google目前没有任何内容在拖延我的记忆。 I skimmed over this, maybe something in it will help? 我略过了这一点,也许它会有所帮助?

https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/0EdNev3NNsw https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/0EdNev3NNsw

I can't promise the above has a silver bullet for you, but it seems like there's good discussion about how Windows filemode messes up git indexes, sometimes. 我不能保证上述内容对您有帮助,但是似乎有时关于Windows文件模式如何混淆git索引的讨论很好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM