How to turn a git branch into fork?

前端 未结 3 2036
耶瑟儿~
耶瑟儿~ 2021-01-13 00:12

I have created a branch in my GitHub repo: https://github.com/markmnl/FalconUDP, so there are now two branches: \"master\" and \"single-threaded\". I realise now I will neve

3条回答
  •  孤街浪徒
    2021-01-13 00:42

    I guess your question is specifically: how to create a fork of your own project in the same user account in GitHub. You cannot use the user interface of the website, but you can create a new repository and push the relevant branches to it:

    1. Create new repo, completely empty, without even a README https://github.com/new

    2. Add the new repo as a new remote in your local clone of the original project, let's call this remote fork for example:

      git remote add fork NEW_REPO_URL
      
    3. Push your single-threaded branch to it:

      git push -u fork single-threaded
      
    4. Delete this branch from the original project, assuming your remote is called origin:

      git push origin :single-threaded
      

提交回复
热议问题