All Articles

Creating a Private Fork of a Public Repo on Github

On GitHub when you fork a repo you need to keep the same visibility as the repo you fork. For example if I fork a public repo it needs to remain public.

Luckily there is a way to get the repo and history of it but have it be private - sort of like a private fork.

To do this first create a new blank repo on GitHub and make sure its set to private.

Then clone the public repo you want to fork privately.

Go into the repo you just cloned and change the remote to you newly created repo from earlier as follows:

git remote set-url origin [email protected]

Confirm that the repo has had it’s remote updated correctly by running:

git remote -v

Then simply push and you’re done!

git push