【问题标题】:Hot to push commit id of a specific submodule to main git repository?将特定子模块的提交 ID 推送到主 git 存储库很热?
【发布时间】:2016-02-02 11:08:51
【问题描述】:

我有一个存储库 A,包含两个模块 B 和 C。当我从 A 提交和推送时,B 和 C 的提交 ID 被推送到主存储库。这可以通过

git add -A
git commit -m 'great commit!'
git push origin master

现在,我需要将 B 的提交 ID 推送到主仓库,但 不是 C 的提交 ID。如果它是一个普通文件,我会这样做

git add specific_file.ext
git commit -m 'another great commit!'
git push origin master

但是在子模块的情况下,如何达到相同的结果?

【问题讨论】:

    标签: git commit git-submodules git-commit


    【解决方案1】:

    您推送和提交子模块与文件完全相同:

    git add <submodule name>
    git commit -m "Updated submodule"
    git push origin master
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-10-05
      • 1970-01-01
      • 2014-01-25
      • 2011-05-21
      • 1970-01-01
      • 1970-01-01
      • 2021-01-31
      相关资源
      最近更新 更多