【发布时间】:2016-06-09 17:34:13
【问题描述】:
首先,这个问题可能听起来很愚蠢,但我认为没有其他办法。
对于正在工作的项目之一,我需要添加一个依赖项。有一个脚本可以自动抓取 tarball 存档、解压缩、添加补丁并构建它。就我而言,我有一个 github 项目 (restbed) 的 tarball,它需要他自己的依赖项,作为子模块(asio、openssl 和 catch)。主要问题是存档只包含restbed的源,而不是依赖项。
希望存档中有 .gitmodules 文件
[submodule "dependency/asio"]
path = dependency/asio
url = https://github.com/corvusoft/asio-dependency
branch = master
[submodule "dependency/catch"]
path = dependency/catch
url = https://github.com/corvusoft/catch-dependency
branch = master
[submodule "dependency/openssl"]
path = dependency/openssl
url = https://github.com/corvusoft/openssl-dependency
branch = OpenSSL_1_0_2-stable
所以我尝试了经典的git submodule init,它给了我fatal: Not a git repository (or any of the parent directories): .git。
那么,有没有办法获取项目的依赖关系,还是我必须手动将它们添加到项目中?
谢谢。
【问题讨论】:
-
restbed 是一个 6MB 的克隆。只需克隆它。
-
@jthill 该脚本不支持 git 克隆。另外,我们希望使用 tarball 来获得稳定版本。
-
您的 tarball 不会为您提供稳定版本,因为它不记录依赖项。修复您的脚本以进行结帐和子模块更新。