When should git orphaned branches be used?

前端 未结 2 521
执念已碎
执念已碎 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.

    0 讨论(0)
  • 2021-02-06 23:12

    Another use case by the git online documentation:

    This can be useful when you want to publish the tree from a commit without exposing its full history. You might want to do this to publish an open source branch of a project whose current tree is "clean", but whose full history contains proprietary or otherwise encumbered bits of code.

    0 讨论(0)
提交回复
热议问题