Fork from a branch in github

前端 未结 8 795
名媛妹妹
名媛妹妹 2021-01-30 09:26

Is there a way to fork from a specific branch on GitHub? … For example, moodle has many branches (1.9, 2.0 … and so on). Can a clone be performed of just branch 1.9 and not the

8条回答
  •  独厮守ぢ
    2021-01-30 09:32

    I'm posting here the method I've used. Like the OP I wanted to only copy/fork one branch. But couldn't find an easy way.

    • in your repo create a new branch. It doesn't need to have the same name as the branch you want to fork
    • once created, verify that it is the selected branch, and click "Compare"
    • reverse the order of comparison (I have a userscript for that, see my profile if it's something you want to test).
    • the "base" repository must be yours, with the branch you've created
    • the "head" repository is the original, and the branch is the branch you want to fork
    • hit "create pull request" and continue until the PR is applied

    That's it. You have the branch forked.

提交回复
热议问题