我正在尝试使用 ubuntu 服务器从本地推送到远程 git 存储库
git push production master
我不断收到此错误消息
fatal: protocol error: bad line length character: Agen
fatal: The remote end hung up unexpectedly
所以我做了
ssh <hostname> git-receive-pack <path-to-git-repo>
它给了我这个错误
Agent pid 17671
008c0000000000000000000000000000000000000000 capabilities^{} report-status
delete-refs side-band-64k quiet atomic ofs-delta agent=git/2.7.4
0000
最佳答案
这是典型的 ssh 连接,它会在标准输出中打印一些内容。
例如,在 Ubuntu 服务器上使用的远程帐户有 .basrch
或 .profile
其中有回声。
确保 ssh -T <account>@<ubuntu.server>
不打印任何东西。
例如,如果该帐户自己设置了一个 ssh 代理(如“Why eval the output of ssh-agent?”中),则将打印 ssh 代理 pid。
尽量避免这种情况,特别是考虑到 ssh 代理更适合客户端(我为了缓存 ssh 私钥密码)
关于git push 在远程服务器上产生有关代理进程 ID 的未知错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45528918/