如何修改我的git子模块以使用远程分支?

时间:2013-07-24 22:02:48

标签: git

我有一个包含子模块的远程git存储库(repo A)。我已经分支了子模块引用的存储库,并且想要更新repo A.

我的问题是,如何更新我的项目,以便我的子模块指向我的远程分支,而不是主分区?

1 个答案:

答案 0 :(得分:0)

这是两个步骤:

  • 输入git子模块,并查看相关分支
  • 返回主存储库并将更改提交给子模块引用

例如,第1步:

$ cd /some/project
$ cd vendor/foo
$ git fetch
$ git checkout origin/feature/awesome

第2步:

$ cd ..
git commit -v foo
< editor showing only the commit hash for the submodule changing >