问题描述
我有一个项目A,它是一个库,它用在项目B中。
项目A和B都在github上有一个单独的存储库但B我们有一个A的子模块。
我在库中编辑了一些类,这是在回购库A中,我推入了远程回购库,所以库(回购A )
这些更新没有反映在参考(子模块)子模块引用了前一个提交....我应该怎么做才能更新子模块在git上?
输入子模块目录:
cd projB / projA
A(will not 更新你的父项目B的git状态):
git pull origin master
回到根目录&检查更新:
cd ..
git status
$ b 如果之前更新了子模块,它将显示如下所示的内容:
#目前没有任何分支。
#已更改但未更新:
#(使用git add ...更新将提交的内容)
#(使用git checkout - ...放弃更改在工作目录中)
#
#modified:projB / projA(new commitits)
#
然后,提交更新:
git add projB / projA
git commit -m projA submodule updated
I have a project A which is a library and it is used in a project B.
Both projects A and B have a separate repository on github BUT inside B we have a submodule of A.
I edited some classes on the library, which is in the repo A, i pushed on the remote repo, so the library (repo A) us updated.
These updates does not reflects on the "reference" (the submodule) the submodule refers to a previous commit.... what should i do in order to update the submodule on git?
Enter the submodule directory:
cd projB/projA
Pull the repo from you project A (will not update the git status of your parent, project B):
git pull origin master
Go back to the root directory & check update:
cd ..
git status
If the submodule updated before, it will show something like below:
# Not currently on any branch.
# Changed but not updated:
# (use "git add ..." to update what will be committed)
# (use "git checkout -- ..." to discard changes in working directory)
#
# modified: projB/projA (new commits)
#
Then, commit the update:
git add projB/projA
git commit -m "projA submodule updated"
这篇关于将子模块更新为最新的提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!