代码之家  ›  专栏  ›  技术社区  ›  erikvold

子模块的文件未签出

  •  7
  • erikvold  · 技术社区  · 15 年前

    我正试图添加一个外部回购作为我回购的子模块,所以我遵循 these instructions

    git submodule add git:... vendor
    git submodule init
    git submodule update
    

    然后我累了:

    git submodule init vendor
    git submodule update vendor
    

    我要添加的子模块有子模块,子模块的子模块似乎被签出(即:我看到硬盘上的文件),但子模块本身的文件没有签出。

    知道我做错了什么吗?

    这是 the repo that I'm trying to add as a submodule src 目录是我在签出/克隆中看到的所有内容,以及子目录和文件,或者 ,但例如,我没有自述文件。

    1 回复  |  直到 15 年前
        1
  •  10
  •   Mark Longair    15 年前

    由于git版本1.6.5,您可以使用 --recursive --init 选择 git submodule update 以确保子模块递归初始化和更新。所以,举你的例子来说,以下对我有效:

    $ git submodule add git://github.com/jbalogh/zamboni-lib.git vendor
    remote: Counting objects: 7001, done.
    remote: Compressing objects: 100% (5985/5985), done.
    remote: Total 7001 (delta 1137), reused 6337 (delta 736)
    Receiving objects: 100% (7001/7001), 14.88 MiB | 1.99 MiB/s, done.
    Resolving deltas: 100% (1137/1137), done.
    $ git submodule update --init --recursive
    [... lots of output ...]