本文介绍了git孤立分支的用例是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Git可以使用 git checkout --orphan 命令在同一个仓库中托管多个DAG。一个经常被引用的用例是git的这个特性是为docs和github gh-page孤儿分支分别创建一个静态网站。

孤立分支有哪些其他用例?

解决方案

另一个可能的用途是将多个存储库合并为一个。举几个例子:




  • 在这些情况下,在将它们合并到一个统一树中之前,您将在同一个存储库中拥有两个单独的DAG。
  • 因此,这不是一个长期使用,而是暂时通过在同一个存储库中分离DAG的状态的操作。


    Git can host multiple DAGs in the same repo with git checkout --orphan command. A frequently cited use case this feature of git is to keep separate branch for docs and the github gh-pages orphaned branch for creating a static website.

    What are some other use cases for orphaned branches?

    解决方案

    Another possible use of this is for combining multiple repositories into one. A few examples:

    In these cases you will have two separate DAGs in the same repository before they are merged into a single unified tree. Thus this is not as much a long-term use, but an action that will temporarily pass through the state of having separate DAGs in the same repository.

    这篇关于git孤立分支的用例是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 13:13
查看更多