Git push failed - unpack-objects abnormal exit

后端 未结 12 2153
长发绾君心
长发绾君心 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:22

    If you use a HTTP URL, you cannot push data via HTTP. HTTP is for read only access. Use ssh instead.

    Do git remote -v to check if your repository URL is a HTTP one. You can change this URL by doing this git remote set-url origin ssh:user@server/dir/project.git

    After that, you can push!

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

    Do check the permissions on the remote/origin repository. Are they writeable by the git user? If not, you will get this error. Something like:

    chown git_user.git_user -R /path/to/repo/your_funky_repo
    

    should do the trick on *nix systems. If your remote is on windows, I am sure there's something equivalent you could run.

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

    I successfully pushed it using "git push —no-thin origin HEAD"

    Sometimes when we execute git push to push a new branch to a remote repository, it will be blocked by the remote repository.

    Maybe we don't have the appropriate permissions. However, when I add the --no-thin parameter to git push, I can push it up.

    However, this command may be affected by different levels of permissions, so there is no guarantee that it will be pushed. But I succeeded with this push.

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

    I encountered this problem when I set up a fresh remote server and created the remote git repo/folders with my root user (rather than my personal user acct). Problem fixed by deleting the git repos and redoing them with my personal account. all works as expected now.

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

    Also check if your disk is not full. I ran into the same problem on one of my VPS few minutes ago.

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

    On my (gitlab) server, I needed first to chown -R git:git repositories/ , but git repack did not work. The issue was solved when I used scp to copy the object file from my local repo to the server:

        scp .git/objects/0d/449dd91d8c20c1820d1284371b28637e08a0f3 root@server:/home/git/repositories/my/project.git/objects/0d/
    
    0 讨论(0)
提交回复
热议问题