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.