使用Git如何合并远程分支的子树 [英] Using Git how to merge a subtree from remote branch

查看:94
本文介绍了使用Git如何合并远程分支的子树的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Git中的子树很好地工作,尽管一些git命令仍然需要支持子树。



这里有个问题:

如何使子树从另一个远程分支如stable或集成?






仅供参考,我们有一个子树push作为脚本工作。实际上,它甚至可以将子树推送到远程存储库上我们选择的特定分支。



有人知道如何在拉动或反向拉伸线索?

简单的拉动是这样的:

  git pull -s subtree remotebranch 

可以尝试的一个想法是:也许两个步骤的过程将完成招。


  1. 远程分支从远程存储分支中取出,例如 stable ,然后

  2. 执行 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.

  1. The remote branch gets pulled from remote repository branch like "stable" and then
  2. do the git subtree pull to master?

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆