【发布时间】:2016-09-28 10:16:50
【问题描述】:
我的工作场所最近切换到了 git 和设置组件的权力,这些组件作为子模块在项目之间共享,这导致试图弄清楚如何使用它们的人们普遍感到沮丧。
看了一些网上的建议,我把项目和子模块拉下来如下:
git pull --recurse-submodules
git submodule update --recursive --remote --init --merge
但是,有时检查子模块的状态会给我如下信息:
> git status
On branch feature
Your branch is behind 'origin/feature' by 1 commit, and can be fast-forwarded.
(use "git pull" to update your local branch)
nothing to commit, working directory clean
如果我这样做就解决了
git submodule foreach git pull
我很茫然。你能告诉我我做错了什么吗?
谢谢!
【问题讨论】:
-
stackoverflow.com/a/21195182/6194839 也许
git submodule update --remote --merge或git submodule foreach git pull origin master会起作用吗?也许git submodule --help可能会为您指明正确的道路。我的第一个问题是您可能有一个命令--recursive --remote --init --merge并没有按照您的想法执行。 -
你能澄清为什么你认为你做错了什么吗?除非您告诉它们,否则子模块不会更新。
-
@eis,我的印象是
git submodule update会从子模块中提取最新的,但显然不会
标签: git