Fork from a branch in github

前端 未结 8 707
名媛妹妹
名媛妹妹 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:46

    A fast, alternative approach is to create your own new repo.

    Go to https://github.com/new and make a new repo. Do not initialize with README.

    Scroll down to get your git remote

    Then:

    git remote rm origin
    git config master.remote origin
    git config master.merge refs/heads/master
    // Run code from above image
    git push --set-upstream origin yourbranchname
    

    You will have a new repo with the original repo's code and a branch that can be made into a pull request.

提交回复
热议问题