Forking Your Own GitHub Project

Forking a project on GitHub is as easy as a button click. Well, unless you’re forking your own project.

Say you have a project called old_project, and you wand to fork it into a new project called new_project.

This is how to do it:

First, open a new repository at GitHub and call it “new_project”.

Now, in your terminal:

git clone git@github.com:USERNAME/old_project.git new_project

cd new_project

vim .git/config

replace old_project with new_project in the following line:

url = git@github.com:USERNAME/old_project

Save and quit vim (:wq)
Back to your terminal.

git remote add upstream git@github.com:USERNAME/old_project

git push -u origin master

Done.

Source.


Leave a Reply