什么时候应该使用git孤立分支? [英] When should git orphaned branches be used?
问题描述
Git可以使用git checkout --orphan
命令在同一存储库中托管多个DAG. git的此功能是一个经常被引用的用例,它是为文档保留单独的分支,或者为创建静态网站保留GitHub gh-pages
孤立的分支.
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 a branch for docs or the GitHub gh-pages
orphaned branch for creating a static website.
还有其他在git中使用孤立分支的原因吗?
Are there other reasons to use orphaned branches in git?
推荐答案
此方法的另一种可能用途是将多个存储库合并为一个.一些例子:
Another possible use of this is for combining multiple repositories into one. A few examples:
- http://www.gelato.unsw.edu .au/archives/git/0506/5511.html
- http://jasonkarns.com/blog/merge-两个git-repositories-into-one/
- 组合多个git仓库
- http://www.gelato.unsw.edu.au/archives/git/0506/5511.html
- http://jasonkarns.com/blog/merge-two-git-repositories-into-one/
- Combining multiple git repositories
在这些情况下,在将它们合并到单个统一树中之前,您将在同一存储库中拥有两个独立的DAG.因此,这不是长期使用,而是一种操作,它将暂时通过在同一存储库中具有单独的DAG的状态.
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孤立分支?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!