Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fork a non-GitHub repo on GitHub?

Tags:

git

branch

github

Is there a best practice for this? I was thinking either to

  • Create a repo, add original repo as upstream remote

  • Create a "mirror" repo, then fork that

  • Create a "mirror" repo, then create a "topic branch"

  • Something else

related: help.github.com/send-pull-requests

like image 738
Zombo Avatar asked Feb 13 '12 22:02

Zombo


2 Answers

This is what I ended up doing:

  1. Create new repo on GitHub

  2. Clone the new repo

    git clone [email protected]:svnpenn/spoon-knife.git
    
  3. Add source code from original repo

    cd Spoon-Knife
    git remote add upstream git://spoon.com/knife.git
    git fetch upstream
    git merge upstream/master
    
  4. Push original source code to new repo

    git push origin master
    
  5. At this point you can start committing your own source code!

source: help.github.com/fork-a-repo

like image 67
Zombo Avatar answered Oct 03 '22 17:10

Zombo


GitHub allows you to import an existing repository on Git, Subversion, Mercurial, and TFS.

See https://github.com/new/import

like image 30
Dakshin Avatar answered Oct 03 '22 19:10

Dakshin