Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
377 views
in Technique[技术] by (71.8m points)

git - error: failed to push some refs to (host+location of init bare)

I create new user and give chmod, but is still cannt push to server
also i create .ssh file in server with kay , which is my public key
can i push to github and github kay link to my server or what to do?

USER@DESKTOP-3FAA4O5 MINGW64 ~/Documents/RestAPI/site-restapi/proj (master)
$ git push origin master
Enumerating objects: 41, done.
Counting objects: 100% (41/41), done.
Delta compression using up to 4 threads
Compressing objects: 100% (37/37), done.
Writing objects: 100% (41/41), 329.49 KiB | 3.02 MiB/s, done.
Total 41 (delta 12), reused 0 (delta 0), pack-reused 0
error: remote unpack failed: unable to create temporary object directory
To (amazon ec2 instance):/var/www/html/project/project.git
 ! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to '(amazon ec2 instance):/var/www/html/project/project.git'
question from:https://stackoverflow.com/questions/65908476/error-failed-to-push-some-refs-to-hostlocation-of-init-bare

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This message:

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

indicates that something is wrong on the server, most likely a permissions issue. This is not fixable on your own machine. You must log in to the Amazon EC2 instance itself (perhaps with ssh) and fix the issue there. First, however, make sure that when you use git push to log in to the Amazon EC2 issue with ssh, you are logging in as the correct user: the same one you used to set up the repository in the first place. That user would normally have all the requisite permissions.

(To push successfully, the user executing the Git program over on the EC2 instance must have permission to create temporary object directories within the Git repository there. The files that your Git program on your machine sends, wind up in the temporary "quarantine" directory on the EC2 instance, where they sit until they are inspect and pass the quarantine inspection. Then they get migrated and/or integrated into the regular files, which also requires appropriate permissions. Once all objects are stored in the repository's objects/ directory, the Git program on the server will update the references in the repository's refs/ or packed-refs directory or file as appropriate, then delete the quarantine directory.)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...