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



我正在尝试使用 ubuntu 服务器上的本地 git 存储库推送到远程 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连接,它在stdout中打印一些东西。
例如,Ubuntu服务器上使用的远程帐户具有具有回显的.basrch.profile

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

例如,如果该帐户本身将设置一个ssh代理(如"为什么要评估ssh-agent的输出?"(,这将打印ssh代理pid。

尽量避免这种情况,特别是考虑到ssh代理更适合客户端(我为了缓存ssh私钥密码(

问题是我在尝试从 github 设置另一个存储库并进行 git 克隆时在我的 .bashrc 文件中设置了一个 ssh 代理。但就像 VonC 指出的那样,代理正在打印上面的消息并阻止我推送到新的存储库。