Git 错误:RPC 失败;结果=22,HTTP 代码 = 404

问题描述:

我在 OSX 上使用 SourceTree 并使用 Git 推送到 Visual Studio Online.我收到以下错误:

I'm using SourceTree on OSX and using Git to push to Visual Studio Online. I get the following error:

POST git-receive-pack(490857233 字节)
错误:RPC 失败;结果=22,HTTP 代码 = 404
致命:远端意外挂断
一切都是最新的
已完成但有错误,见上文

POST git-receive-pack (490857233 bytes)
error: RPC failed; result=22, HTTP code = 404
fatal: The remote end hung up unexpectedly
Everything up-to-date
Completed with errors, see above

我已经尝试了以下方法:

I have already tried the following:

git config --global http.postBuffer 524288000

我刚刚遇到了一个非常类似的错误(这个答案是谷歌搜索结果的最高结果)——解决方案在@Liviu Chircu 的评论中

I just ran into a very similar error (for which this answer is the top google result) - the solution was in a comment by @Liviu Chircu

解决方案是将 .git 放在 url 的末尾

The solution was to put the .git on the end of the url

git clone http://myURL/projectname
Cloning into 'projectname'...
error: RPC failed; result=22, HTTP code = 404
fatal: The remote end hung up unexpectedly

然而:

git clone http://myURL/projectname.git

成功.

奇怪的是,没有.git的原始URL在两台linux机器和一台windows桌面上成功,但在第三台linux机器上失败.包括 .git 使它在所有机器上都能工作.

The strange thing is that the original URL without .git succeeded on two linux machines and a windows desktop, but failed on a third linux machine. Including .git makes it work on all machines.