How can I fork my own GitHub repository?
You're doing the right thing.
cd ~/Sites/
git clone ~/Dev/markupDNA/ project-N
cd project-N
git remote rename origin markupDNA
- Nav to the folder where you store your projects
- clone your base
markupDNA
repo with custom name - rename the remote so that if you want to an 'origin' later, you can
It will probably be a lot easier to use branches, rather than using separate forks. You can still have separate checkouts for each branch; just clone your repo multiple times, and use git checkout
in each one to switch it to the appropriate branch (or git checkout -b
to create the branch and check it out all at once). Once you have created the branches, you can push them to GitHub using git push origin <branchname>
.
This tutorial gives a simple and straightforward answer :
- Create a new empty github
forkedrepo
repository -
Clone it locally:
git clone https://github.com/YOURUSERNAME/forkedrepo.git
-
Add the original github repository as remote of the new local repository:
git remote add upstream https://github.com/YOURUSERNAME/originalrepo.git
-
Pull down a copy of the original github repository to your new local repository:
git pull upstream master
-
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.