How can I fork my own GitHub repository?

前端 未结 7 2309
南笙
南笙 2020-11-30 06:19

So, total newbie to Git. Been reading through the guides and think I have the basics but am having difficulties accomplishing this one goal.

I have a repo created fo

7条回答
  •  时光说笑
    2020-11-30 06:52

    This tutorial gives a simple and straightforward answer :

    1. Create a new empty github forkedreporepository
    2. Clone it locally:

      git clone https://github.com/YOURUSERNAME/forkedrepo.git
      
    3. Add the original github repository as remote of the new local repository:

      git remote add upstream https://github.com/YOURUSERNAME/originalrepo.git
      
    4. Pull down a copy of the original github repository to your new local repository:

      git pull upstream master
      
    5. Push the files from your new local repository to new github repository:

      git push origin master
      

    This won't be recognized by github as a fork of the original repository, off course, but this is as good as it gets.

提交回复
热议问题