When should git orphaned branches be used?

前端 未结 2 551
执念已碎
执念已碎 2021-02-06 22:42

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 doc

2条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-06 23:07

    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-two-git-repositories-into-one/
    • Combining multiple git repositories

    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.

提交回复
热议问题