git - 如何更新git子模块

标签 git git-submodules git-merge

我刚刚做了一个 git merge <merging_branch_name>在应用程序中解决了许多冲突。

但是当我做 git status ,我可以在消息中看到带有(新提交)的子模块列表。 看起来子模块(分支/标签)版本尚未更新。

例如:

modified:   plugins/myplugin.git (new commits)

如何使用版本更新子模块(使用 <merging_branch_name> )

我在 git bash 中是这样的

my_app (current_branch  |MERGING), 

所以当我做 git status ,我得到如下子模块列表

 modified:   plugins/plugin1.git (new commits)
 modified:   plugins/plugin2.git (new commits)
 modified:   plugins/plugin3.git (new commits)
 modified:   plugins/plugin4.git (new commits)

我该如何解决?

最佳答案

要将子模块内容更新为新的 SHA1,这应该足够了:

# the submodule content needs to be updated
git submodule update --init

# the parent repo needs to record the new submodule SHA1
git add plugins/myplugin

关于git - 如何更新git子模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30069130/

相关文章:

git - 检查过去的 git 子模块提交

git - 使用Git从 "Repo"仓库同步一个项目

python - 将 Pipenv 与 git 子模块一起使用

git - 如何找到大文件中 merge 冲突的位置?

git - 有没有一种方法可以干净轻松地撤消 git merge?

git - 共享数据容器中的开发和版本控制

windows - Jenkins 不能很好地处理私有(private) GitHub 存储库 (Windows)

git rm -r 在子模块中不起作用

git - 重用 git 存储库的一部分

git - 显示不同的 github 分支之间的差异?