问题
I have a bare git repo on a samba share server which my team are able to push to but when I try to push I get the error:
remote: fatal: sha1 file './objects/pack/tmp_pack_<changes-with-every-push>' write error: Operation not supported
error: unpack failed: index-pack abnormal exit
To /run/user/1000/gvfs/smb-share:server=<ip-address>,share=<share>/<directory>/<bare.git>
! [remote rejected] <my-branch> -> <my-remote-branch> (unpacker error)
Here's a list of what I've tried:
- I copied the bare repo from the server to my machine and was able to push to that (The bare.git repository is fine then)
- I made a copy of the bare repo on the server (and added as a second remote) but the same error message appears when I push to it (So something to do with the samba share?)
- I put another copy of the bare repo onto usb, successfully pushed to it and a member of my team was able to pull my branch to his local repo and successfully push to the server via samba from there (So maybe it isn't samba)
- I then created a new branch from stable and was able to push a single text file from there (So git will take a single text file commit but not all from my working branch, but it can't be my commits as my colleague was able to push my branch from his machine)
- I've run gc with both prune and aggressive flags and git fsck returns no problems
- I've reinstalled both the smbclient and git with no success.
The "operation not supported" error makes me think that there's some system call problem on the server end that's making git return the error.
I've not managed to find anyone who has had this problem before. Any ideas?
回答1:
So I finally solved this problem.
I had mounted the server through Nautilus using "Connect to Server" which mounted it as:
/run/user/1000/gvfs/smb-share:server=<ip-address>,share=<share>/<directory>/<bare.git>
I decided to unmount and mount the server to /mnt/mountpoint using information provided in this question.
It works now and I'm able to push my branch on the remote, but only when I'm a sudo user. I haven't got round to fixing this yet but that's a problem for another day when I have time. Hope anyone else who has this problem finds my answer useful.
来源:https://stackoverflow.com/questions/46242327/git-push-write-error-operation-not-supported