Git push “write error: Operation not supported”

左心房为你撑大大i 提交于 2020-07-21 06:13:08

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!