问题描述
Git可以使用 git checkout --orphan
命令在同一个仓库中托管多个DAG。一个经常被引用的用例是git的这个特性是为docs和github gh-page孤儿分支分别创建一个静态网站。
孤立分支有哪些其他用例?
另一个可能的用途是将多个存储库合并为一个。举几个例子:
- 在这些情况下,在将它们合并到一个统一树中之前,您将在同一个存储库中拥有两个单独的DAG。 因此,这不是一个长期使用,而是暂时通过在同一个存储库中分离DAG的状态的操作。
- http://thread.gmane.org/gmane.comp.version-control.git/5126/
- http://jasonkarns.com/blog/merge-two-git-repositories-into-one/
- Combining multiple git repositories
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孤立分支的用例是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!