git push在远程服务器上产生有关代理进程ID的未知错误

时间:2017-08-06 05:37:23

标签: git ubuntu

我正在尝试使用

从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

2 个答案:

答案 0 :(得分:1)

这是典型的ssh连接,它在stdout中打印一些东西 例如,Ubuntu服务器上使用的远程帐户有.basrch.profile,其中包含echo。

确保ssh -T <account>@<ubuntu.server>无法打印任何内容。

例如,如果该帐户本身设置了ssh代理(如“Why eval the output of ssh-agent?”),则会打印ssh代理pid。

尽量避免这种情况,特别是考虑到ssh代理更多的是客户端(我命令缓存ssh私钥密码)

答案 1 :(得分:0)

问题是我在我的.bashrc文件中设置了一个ssh代理,同时尝试从github设置另一个存储库并执行git clone。但是,就像VonC指出代理人打印出上面的消息并阻止我推送新的回购。