How to Manually Fork a GitHub Repo

Github doesn’t allow you to fork one of your own repositories to your account. In my case the reason this issue raised it’s ugly head is I’ve a private repo that I need to fork. I can’t just fork it to another user account because then I’d have to pay for a second account to support private repos.

So here’s my workaround.

  1. Create a new empty repo on Github.
  2. Clone the new empty repo down to my local dev machine.
  3. Add the original repo as the upstream of the new local repo.
  4. Now just fetch and merge the upstream master to new repo master.

In this way I can pull and push code between the two repos. The downside with this is Github doesn’t see the second repo as a fork. So there will be no managing pull requests in the Github UI.


$ git clone git@github.com:CreativeNotice/MyNewRepo.git
$ git remote add upstream git@github.com:CreativeNotice/Kraken-CF.git
$ git fetch upstream master
$ git merge upstream/master master
$ git push