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

Un-tracking Files in Git OR Why doesn’t Git Use My .gitignore File?

Recently, while working on a CF / IIS7.5 site, I found that the web.config file was being synced from server to developer and back again.

Obviously this is a bad since that file is specific for each server. Adding [Ww]eb.config to the .gitignore file didn’t stop Git from tracking changes.

Ends up you need to specifically tell Git to stop tracking a file it’s already started to track. You do this using the following simple command:

git update-index --assume-unchanged FILENAME

It took a little bit of time to find the answer, since I was searching incorrectly for “gitignore web.config”, but finally found a concise answer from Samuel Huckins. Thanks Sam!