将文件推送到本地git服务器

时间:2015-07-01 09:50:24

标签: git nginx push

我已经使用nginx设置了一个本地git服务器并且我已经能够提取文件了但是我还没能将它们推回去,我总是得到以下错误:

remote: error: insufficient permission for adding an object to repository database objects
remote: fatal: failed to write object
error: unpack failed: unpack-objects abnormal exit
To https://localhost/git/repo.git
 ! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to 'https://localhost/git/repo.git'

有关可能导致问题的原因以及如何解决问题的任何帮助?

1 个答案:

答案 0 :(得分:0)

您正试图通过httphttp是一个只读协议,所以你不能推动这个协议,

将网址更改为https,您就可以写入存储库了 - 它会提示您输入密码或使用ssh设置ssh-keygen -t rsa -C "email"密钥,然后添加到您的远程服务器。

从这一点开始,你可以使用ssh来推送。

要点:

http是只读的,因此您需要使用ssh或https。

相关问题