-->

是什么混帐子树合并和git-子树之间的差异(What is the difference betwe

2019-06-26 16:07发布

我只是发现git的子树的工具,前一段时间成为主要的git回购协议的一部分https://github.com/apenwarr/git-subtree/

不过,我不完全了解什么功能此工具是否可以在现有的“混帐阅读树” +“混帐合并-s子树”。 是git的子树的唯一purpouse - 使得最终提交历史更好看?它有什么,我已经忽略了更多的功能?

Answer 1:

您所描述的命令读取子树到存储库。 在git-subtree命令有许多更多的选项,如通过描述的文档。 其中,你可以(注释为简单起见):

add::
    Create the <prefix> subtree by importing its contents
    from the given <refspec> or <repository> and remote <refspec>.
merge::
    Merge recent changes up to <commit> into the <prefix>
    subtree.
pull::
    Exactly like 'merge', but parallels 'git pull' in that
    it fetches the given commit from the specified remote
    repository.
push::
    Does a 'split' (see above) using the <prefix> supplied
    and then does a 'git push' to push the result to the 
    repository and refspec. This can be used to push your
    subtree to different branches of the remote repository.
split::
    Extract a new, synthetic project history from the
    history of the <prefix> subtree.  The new history
    includes only the commits (including merges) that
    affected <prefix>, and each of those commits now has the
    contents of <prefix> at the root of the project instead
    of in a subdirectory.  Thus, the newly created history
    is suitable for export as a separate git repository.

也有各种标志,援助和操纵以上。 我相信,所有这些选项都可以通过管道命令链之前。 git-subtree.sh只是包装他们,使他们相当容易执行。



Answer 2:

如果你看一下旧树代码得到了加与git作为的contrib模块收到: https://github.com/apenwarr/git-subtree/blob/master/git-subtree.sh你可以看到git的子树工具真的是围绕着较低的水平git的子树合并策略更先进的包装。

它主要利用了一个明智的方式,使子树的管理更容易的策略。 特别是--squash的东西是真的,真的有用。



文章来源: What is the difference between git subtree merge and git-subtree