使用Git如何合并远程分支的子树 [英] Using Git how to merge a subtree from remote branch
问题描述
Git中的子树很好地工作,尽管一些git命令仍然需要支持子树。
这里有个问题:
如何使子树从另一个远程分支如stable或集成?
仅供参考,我们有一个子树push
作为脚本工作。实际上,它甚至可以将子树推送到远程存储库上我们选择的特定分支。
有人知道如何在拉动或反向拉伸线索?
简单的拉动是这样的:
git pull -s subtree remotebranch
可以尝试的一个想法是:也许两个步骤的过程将完成招。
- 远程分支从远程存储分支中取出,例如
stable
,然后 - 执行
git子树拉
到master
?
此致
Wayne
可能(未测试) git子树脚本工具可能对此有所帮助。
查看其手册页
它可以在你自己的仓库中合并/拉取一个子项目,但它可能涉及所有分支,所以你的两步过程仍然需要。
Subtrees in Git work nicely although some git commands remain to be supported for subtrees.
Here's the question:
How to make the subtree pull from a different remote branch like "stable" or "integrate"?
FYI, we have a subtree "push"
working as a script. In fact, it can even push the subtree to the specific branch of our choice on the remote repository.
Does anybody know how to do the reverse on a pull or even have a clue?
The simple pull works like this:
git pull -s subtree remotebranch
One idea that can be tried: Maybe a 2-step process will do the trick.
- The remote branch gets pulled from remote repository branch like "
stable
" and then - do the
git subtree pull
tomaster
?
Sincerely, Wayne
May be (not tested) the git subtree script tool may help here.
See its man page
It can merge/pull a subproject in your own repo, but it may concern all branches, so your two-step process could still be needed.
这篇关于使用Git如何合并远程分支的子树的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!