Git push failed - unpack-objects abnormal exit

后端 未结 12 2154
长发绾君心
长发绾君心 2020-12-09 07:38

I\'m using remote git repository. I successfully commit my files and now I\'m trying to push it up to stream.

Operation fails with this messasge:

git         


        
相关标签:
12条回答
  • 2020-12-09 08:30

    If your git repo is self hosted, check the file system rights on the remote git directory. If this gets corrupted, it is possible that your git server just doesn't have rights.

    For instance, I host my own gitosis system on Ubuntu server. When I create the git repo on the server, I run sudo git init --bare <repo name> I then have to run sudo chgrp -R gitosis <repo name> && sudo chown -R gitosis <repo name>.

    0 讨论(0)
  • 2020-12-09 08:30

    I've run into the same trouble when I changed my git from VPN to https connection.

    Something happend in my git Repository and I couldn't push anymore, but pull still worked. I also tried the Solution with git -repack remote/origin/master, but still same Issue.

    To solve this, I just made a new clone from my repo with the new connection and was able to use push methods as known. I don't know really why this couldn't be solved by git -repack, but in this way it works for sure!

    I guess there was something that doesn't fit with the VPN remote settings for the Server as I changed the access method to https.

    Hope this helps.

    0 讨论(0)
  • 2020-12-09 08:31

    In my case, the remote repo was a shallow clone. I was pushing a merge commit which apparently was using commits dated before the earliest commit the shallow repo had.

    To fix this you need to unshallow the remote: git fetch --unshallow

    0 讨论(0)
  • 2020-12-09 08:35

    On Windows, the only fix that worked for me was to remove the following lines from my .gitconfig file:

    [credential]
    helper = !'C:\\Users\\YourNameHere\\AppData\\Roaming\\GitCredStore\\git-credential-winstore.exe'
    

    Once I did that, I manually pushed once (successfully), then added the above lines back to .gitconfig, and everything worked.

    0 讨论(0)
  • 2020-12-09 08:38

    According to this article git repack remote/origin/master might help in case your local repository was corrupted. To check that you can try cloning your remote repo into new directory and test push from it.

    0 讨论(0)
  • 2020-12-09 08:38

    This also occurs when the remote has no space left on it, try free up some space.

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