git显示在Mac NFS文件系统上更改的随机文件 [英] git shows random files changed on Mac NFS filesystem

查看:209
本文介绍了git显示在Mac NFS文件系统上更改的随机文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在工作中遇到了一个奇怪的问题,我一直无法弄清楚。我们都在我们的台式机上使用带有Snow Leopard的MacBook,并且我们也有一些远程使用的Linux服务器。我的一些团队成员将git存储库放在Mac和Linux服务器之间共享的NFS文件系统上,这样他们就不必考虑在其个人工作流程中共享代码库之间的代码。

这是奇怪的开始,在OSX机器上,当你尝试合并时,git会随机地显示一些文件过期 in status 切换分支等。如果您运行 git status ,则不会显示过期的文件。 gitk 会将文件显示为已修改但未以相同方式正常执行的方式提交。如果你 reset --hard 这些文件,你可以有时在这个重新出现之前更改分支,但大多数情况下不会。如果您登录到其中一台Linux机器并查看同一个存储库,那么所有功能都可以正常工作这些文件没有被标记为已更改,您可以随心所欲地做任何事情。



我已经消除了行结尾差异和文件模式差异作为罪魁祸首,但我不确定还有什么可以尝试的。是否有一些OSX特定的NFS交互需要我们以某种方式解决? 解析方案

也许服务器和工作站之间的非同步时间使得文件修改时间不可靠。设置 core.trustctime 有帮助吗? (默认情况下是这样)。
还有一个更重的设置: core.ignoreStat 忽略完整的 stat(2)信息更改检测代码。


We have a strange problem here at work that I've been unable to figure out. We all use MacBooks with Snow Leopard on our desktops and we have a handful of Linux servers we also use remotely. Some of my team members put git repositories on an NFS filesystem that's shared between both the Mac's and the Linux servers so they don't have to think about sharing code between repositories in their personal workflow.

This is where the strange starts, on the OSX machines git will randomly show some files out of date in status when you try to merge or switch branches etc. If you run git status no files are shown out of date. gitk will show the files as modified but not committed in the same way status normally does. If you reset --hard those files you can sometimes change branches before this reoccurs but mostly not. If you log into one of the Linux machines and view the same repository everything works perfectly. The files are not marked as changed and you can do whatever you like.

I've eliminated Line ending differences and file mode differences as the culprit but I'm not sure what else to try. Is there some OSX specific NFS interaction that we have to work around somehow?

解决方案

Maybe unsynchronized time between the servers and workstations makes the modification times of the files unreliable. Does setting of core.trustctime help? (it is true by default). There is an even heavier setting: core.ignoreStat to ignore complete stat(2) information in the change detection code.

这篇关于git显示在Mac NFS文件系统上更改的随机文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆