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

只克隆.gitmodules中的一些模块,不使用分支配置

git
  •  1
  • SimpleJ  · 技术社区  · 6 年前

    我的 .gitmodules

    [submodule "server"]
        path = server
        url = https://github.com/companyName/app-name-server
        branch = master
    [submodule "client"]
        path = client
        url = https://github.com/companyName/app-name-client
        branch = master
    [submodule "deploy-instructions"]
        path = deploy-instructions
        url = https://github.com/companyName/app-name-deploy-instructions
        branch = master
    [submodule "shared"]
        path = shared
        url = https://github.com/companyName/app-name-shared
        branch = master
    

    当我克隆回购并运行 git submodule update --init --recursive ,的 server client 子模块被拉,但是 deploy-instruction shared 不要。两者兼而有之 服务器 不在主分支上。

    这里发生了什么?

    1 回复  |  直到 6 年前
        1
  •  1
  •   VonC    6 年前

    另外,服务器和客户端都不在主分支上。


    如果希望它们拉动主分支并更新到其头部,则需要:

    git submodule update --remote
    

    部署指令和共享命令。

    检查测试结果 git ls-files --stage | grep 160000 :如果看不到这两个文件夹,则表示它们的gitlink已被同名的实际(非子模块)文件夹覆盖。