【问题标题】:How to download git repository without using git如何在不使用 git 的情况下下载 git 存储库
【发布时间】:2013-07-21 01:07:01
【问题描述】:

我正在通过一些教程学习 git,但我想要一个 git 存储库来练习。

但由于防火墙或其他原因,此命令不起作用

$git clone git://git.kernel.org/pub/scm/git/git.git

我可以将 repo 作为压缩文件下载,或者我如何递归下载 url 显示为带有目录的 html 页面?

【问题讨论】:

标签: git http firewall


【解决方案1】:

你可以的

wget --no-check-certificate -O kernel.zip https://github.com/repo/repo/archive/branch.zip
unzip kernel.zip

【讨论】:

【解决方案2】:

@PetrMensik 有answered 提出的问题,即如何在不使用 Git 的情况下下载存储库。

但是,OP 提到避免使用 Git 的一个可能原因是防火墙。如果是这种情况,那么您需要避免的不是 Git 程序,而是 Git protocol

只需在克隆 URL 中将 git:// 替换为 https:// 即可:

git clone https://git.kernel.org/pub/scm/git/git.git

正如 OP 正确猜测的那样,Git 协议使用的端口在许多公司防火墙上被阻止。 SSH 也是如此,它是另一种可以与 Git 一起使用的协议。但是,HTTPS 流量很少被阻止,否则您将无法安全访问网站。

【讨论】:

    猜你喜欢
    • 2021-01-18
    • 2018-07-04
    • 1970-01-01
    • 2018-08-06
    • 2021-01-27
    • 1970-01-01
    • 2016-01-15
    • 1970-01-01
    • 2022-08-14
    相关资源
    最近更新 更多