Git, error: remote unpack failed: unable to create temporary object directory - By creating new Branch

南楼画角 提交于 2020-07-29 05:24:26

问题


Good Day.

I Try to create a new Branch in my Repo.

I made this:

Git branch events

Git Checkout events

That worked. So I changed some files and made

Git Status

Git add --all

Git Commit -m "Commit"

That worked well but I tried to push it and that didn't work:

Git push -u origin events

This is the Error:

Enumerating objects: 9, done.
Counting objects: 100% (9/9), done.
Delta compression using up to 4 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 716 bytes | 716.00 KiB/s, done.
Total 5 (delta 4), reused 0 (delta 0)
error: remote unpack failed: unable to create temporary object directory
To http://git.int.censoredlink/scm/freeb/freebrep.git
! [remote rejected] events -> events (unpacker error)
error: failed to push some refs to 'http://stsu@git.int.censoredlink/scm/freeb/freebrep.git'

I don't know why it don't work.

I have Admin rights on the Repo. I censored the link to the repo because its a Intern Repo with Private link hope thats ok.

Hope someone can help me.


回答1:


This error message:

error: remote unpack failed: unable to create temporary object directory

indicates that the Git repository at the server (not your Git) is out of space, or running into similar server problems,1 or installed incorrectly. That is, given:

To: http://git.int.censoredlink/scm/freeb/freebrep.git

you will have to log in to the machine that serves HTTP traffic at git.int.censoredlink, walk down to the scm/freeb/freebrep.git directory, and correct the installation there. It's most likely a permissions issue: the receiving Git must be able to create, in the objects area, a directory named incoming-XXXXXX with the Xs replaced by a unique identifier, and then create within that directory a pack subdirectory.

All incoming objects and pack files are placed in these directories, in a sort of quarantine procedure, until the server-side Git hooks are satisfied with the reference name update requests. If the push fails, the quarantine directory is simply removed. If the push succeeds, the quarantined objects and/or pack files are migrated (and thin packs adjusted) into the normal object storage area. Note that the migration can fail even if the quarantine process succeeds; but if it does so, you get a different error reported to the client. (This error must also be corrected on the server.)

Note: it's rather unusual to push to http:// rather than https:// or ssh:// URLs. Inspect your server configuration to see who will own the various files thus created, and what permissions the web server will have.


1If a hard drive fails, Linux will sometimes mark the drive and/or its file systems read only. Or, even if you have disk space, you can run out of inodes. A number of different root causes will all lead to the same observed behavior on your client end. If you are a Linux admin checking on a server, look for system log messages, and consider both df and df -i output.




回答2:


I was getting the same error until I removed a .git subdirectory in the remote git repository.

The .git subdir was not writable by the git login account. Initially I had a permissions problem when trying to commit, and I suspect the .git subdir was created then.




回答3:


I got redirected here because of this error message.

error: remote unpack failed: unable to create temporary object directory

FYI: This can also occur when you are mounting the git directory read only

eg x.x.x.x:/nas/git on /mnt/git type nfs (ro,.....




回答4:


I faced the same error when i tried pushing to "censored git server". The problem was on the server side. You can wait for some time until the sever gets back online properly or just contact the admin to get it fixed :)




回答5:


If you are working as a root user, please first change the user to your git user and then init your git directory:

  1. if you are root -> $ [root@server ~]#
  2. change user -> $ su - username
  3. init a git repo -> [username@server ~] $ git init --bare git-repo.git
  4. push from client -> Now you can push from the client:
    git remote add yourAliasName ssh://username@IP-or-HOST:sshPort/home/username/git-repo.git

Note:
I supposed you have created a public/private key already in your client and passed the public key to the /home/username/.ssh/authorized_keys server file. Otherwise you have to do it before step(4).



来源:https://stackoverflow.com/questions/51495092/git-error-remote-unpack-failed-unable-to-create-temporary-object-directory

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