git: can't push (unpacker error) related to permission issues

前端 未结 13 913
小蘑菇
小蘑菇 2020-12-07 20:06

I have this problem when i try to push in git:

error: insufficient permission for adding an object to repository database ./objects

fatal: failed to write o         


        
相关标签:
13条回答
  • 2020-12-07 20:55

    I had this error for two weeks, and the majority of the solutions stated 'chmod -R' as the the answer, unfortunately for me my git repos (local / remote / shared - with team) were all on Windows OS, and even though chmod -Rv showed all the files changed to 'rwxrwxrwx', a subsequent 'ls -l' still showed all files as 'rwxr-xr-x' and the error repeated itself. I eventually saw this solution by Ariejan de Vroom. It worked and we were all able to pull and push again.

    On both local (the local that is having trouble pushing) and remote repos, run the following commands:

    $ git fsck
    $ git prune
    $ git repack
    $ git fsck
    

    On a side note, I tried using Windows' native file permissions / ACL and even resorted to elevating the problem user to Administrator, but none of that seemed to help. Not sure if the environment is important, but it may help someone with a similar setup - problem team member and remote (Windows Server 2008 R2 Standard), my local (Windows 7 VM).

    0 讨论(0)
提交回复
热议问题