Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个包含子模块的远程 git 存储库(repo A)。我已经分支了子模块引用的存储库,并希望更新存储库 A。
我的问题是,如何更新我的项目,使我的子模块指向我的远程分支,而不是主分支?
这是两个步骤:
例如,第 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 >