如何在带有子模块的存储库上进行 git checkout?
假设我有一个带有子模块 A
的存储库 X
。现在假设我希望 X 有两个分支:master 和development。我希望 master 拥有与开发版本不同的 A
版本。如何在这些分支之间来回切换?
我已经设置了一个存储库来执行此操作(但使用真实姓名而不是假名!)。问题是,每当我从开发中执行 git checkout master
时,我都会得到以下信息:
$ git co master
M A
Switched to branch 'master'
看起来它没有将 A
返回到 master 引用的提交。有什么办法解决这个问题吗? git submodulesync
和 git submodule update
似乎都没有改变任何东西。
Suppose I have a repository X
with a sub module A
. Now suppose I want X
to have two branches: master and development. I want master to have a different revision of A
than development does. How can I switch back and forth between these branches?
I've got a repository set up that does this (but using real names instead of fake ones!). The problem is that whenever I do git checkout master
from development, I get the following:
$ git co master
M A
Switched to branch 'master'
It looks like it's not putting A
back to the commit that master references. Is there any way around this? Both git submodule sync
and git submodule update
don't seem to change anything.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你需要先进行 git checkout
You need made a git checkout before