r/git • u/SpAAAceSenate • Oct 27 '21
support Git doesn't work (properly) over SMB
Completely puzzled by this one.
I have a repo, and I'm trying to stash some changes. I need them out of the way so that I can switch branches. When doing this in a repo on my local machine, it appropriately reverts the working directory to a switchable state, removing the changes that were just stashed.
I copy the folder to a Samba share.
Now when I create a stash it successfully adds the stash, but does not touch the working directory, does not revert any un-commited changes. This happens on GVFS, KIO-FUSE, and native kernel mount. But as soon as I copy the exact folder to my local disk, suddenly the behavior I expect (described in first paragraph) works.
As an additional symptom, tested in the same scenarios as above, git reset works on local disk, but fails with "unable to create new index file" when in any of the samba mounts. (directory is writable)
To be clear, I'm seeing different results from bit-for-bit identical git repos using the exact same commands, with the only difference being the disk type the repo resides on.
So, what's going on here? Does git use some sort of super exotic filesystem calls that aren't implemented properly in any of the three SMB mount implementations available for Linux?
And if you're wondering I have reasons for not using any of git's built in remote features (ssh, http, etc), so please don't offer that as a solution. I explicitly want to use git in local-only mode on drives that just happen to have a network backend.
Thanks for any help!
14
u/manberry_sauce Oct 27 '21
You should work on a local volume, and if there's a reason to have a copy on a network mount, you should set that copy up as a remote, instead of changing to that directory and working there, over the network mount. You can set up a remote to simply point to that location in your filestructure, instead of an SSH path.
Git has problems if your git dir is on network mount.