如何根据项目URL从github获取整个项目?

时间:2015-11-13 17:25:30

标签: git github

在这种特殊情况下,我试图从项目中获取所有文件

https://github.com/spring-projects/spring-integration-samples/tree/master/basic/amqp

我在Mac OS上,在shell中安装了git。所以我试图构建一个基于How to `git clone` including submodules?或其他类似链接的git clone命令。我的命令都不起作用

1 个答案:

答案 0 :(得分:2)

只需克隆它:

git clone https://github.com/spring-projects/spring-integration-samples.git

然后,如果它有子模块,请使用:

git submodule update --init

这就是全部。

您将整个项目克隆到您的计算机上。如果您对特定的子目录感兴趣,只需浏览它。

据我所知,您感兴趣的目录不是项目的子模块,因此下载后者并访问前者是一种很好的方法。

修改

正如HBHB的评论中所建议的,即使使用一个命令,您也可以这样做:

git clone --recursive https://github.com/spring-projects/spring-integration-samples.git