Git不会启动/同步/更新新的子模块 [英] Git will not init/sync/update new submodules

查看:617
本文介绍了Git不会启动/同步/更新新的子模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是我的 .gitmodules 文件的部分内容:

  [submodulesrc / static_management] 
path = src / static_management
url = git://github.com/eykd/django-static-management.git
[submoduleexternal / pyfacebook]
path = external / pyfacebook
url = http://github.com/sciyoshi/pyfacebook.git

但是, .git / config 只包含第一个:

  [submodulesrc / static_management] 
url = git://github.com/eykd/django-static-management.git

第二个子模块( external / pyfacebook )是由另一位开发人员在功能分支中添加的。我已经继承了这个开发,并且已经检出了这个特性分支。但是,Git不会为我提供子模块。我已经尝试过:


$ li $ $ c $ git子模块init <$ $ c $>

  • git submodule update

  • git submodule update --init

  • git子模块同步

  • 删除所有子模块定义。 git / config 并运行 git submodule init 。它仅复制先前存在的子模块并忽略新模块。 git子模块更新。只有以前存在的子模块会更新。



  • 以各种组合,但git根本不会更新 .git / config 基于 .gitmodules 的新内容,也不会创建 external / pyfacebook 文件夹并拉动子模块的内容。



    我错过了什么?是否需要手动干预(手动添加子模块条目到 .git / config ),为什么?

    编辑:手动干预不起作用。手动将新的子模块条目添加到 .git / config 中并没有什么作用。新的子模块被忽略。

    解决方案

    您最近升级到git 1.7.0.4版吗?我做了,现在有类似的问题... ...编辑:我解决了我的问题,但绝对不知道问题出在哪里。我手动从.git / config和.gitmodules中删除子模块条目,并重新添加我的子模块与ususal步骤(git submodule add etc ...)... Worksforme,但没有增加此线程的价值。

    Here's part of the contents of my .gitmodules file:

    [submodule "src/static_management"]
            path = src/static_management
            url = git://github.com/eykd/django-static-management.git
    [submodule "external/pyfacebook"]
            path = external/pyfacebook
            url = http://github.com/sciyoshi/pyfacebook.git
    

    However, .git/config only contains the first:

    [submodule "src/static_management"]
            url = git://github.com/eykd/django-static-management.git
    

    The second submodule (external/pyfacebook) was added by another developer in a feature branch. I've inherited the development now, and have checked out the feature branch. However, Git will not pull the submodule for me. I've tried:

    • git submodule init
    • git submodule update
    • git submodule update --init
    • git submodule sync
    • Removing all submodule definitions from .git/config and running git submodule init. It only copies over the previously existing submodule and ignores the new one.
    • Entering new submodule definitions in .git/config manually and running git submodule update. Only the previously existing submodules bother to update.

    in various combinations, but git simply will not update .git/config based on the new contents of .gitmodules, nor will it create the external/pyfacebook folder and pull the submodule's contents.

    What am I missing? Is manual intervention (adding a submodule entry by hand to .git/config) truly required, and why?

    Edit: Manual intervention does not work. Manually adding the new submodule entry to .git/config doesn't do a thing. The new submodule is ignored.

    解决方案

    Did you recently upgrade to git version 1.7.0.4 ? I did and am now having similar issues...

    Edit: I fixed my problem but have absolutely no idea whatsoever where the problem was. I manually removed submodule entries from both .git/config and .gitmodules and re-added my submodules with the ususal steps (git submodule add etc...) ... Worksforme but adds no value to this thread.

    这篇关于Git不会启动/同步/更新新的子模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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