如何将`git:`网址转换为`http:`网址 [英] How to convert `git:` urls to `http:` urls

查看:454
本文介绍了如何将`git:`网址转换为`http:`网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个http代理。我试图用他们的回购工具克隆Android的源代码树。

此工具坚持使用 git:// 网址,即使 http:/ / 网址也可以使用。因此,我无法下载源代码。



是否可以强制 git 始终使用 http



编辑: 。例如,这可以工作:

  git clone http://android.git.kernel.org/platform/manifest.git 

但是这不会(errno = Connection超时):

  git clone git://android.git.kernel.org/platform/manifest.git 

因此

以下是一个示例重写GitHub的默认协议:

  git config --global url.https://github.com/.insteadOf git ://github.com/ 


I'm working behind an http proxy. I'm trying to clone Android's source tree using their "repo" tool.

This tool insists on using git:// URLs, even though http:// URLs also work. As a result, I can't download the source.

Is it possible to force git to always use http?

Edit: my http_proxy is configured correctly. For example, this works:

git clone http://android.git.kernel.org/platform/manifest.git

But this doesn't (errno=Connection timed out):

git clone git://android.git.kernel.org/platform/manifest.git

So this answer does not really help me.

解决方案

Here's an example of rewriting the default protocol for GitHub:

git config --global url.https://github.com/.insteadOf git://github.com/

这篇关于如何将`git:`网址转换为`http:`网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆