Skip to content

Instantly share code, notes, and snippets.

@JeViCo
Last active August 19, 2023 18:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JeViCo/8c21c10f701b2a5267fe2908efdba2bf to your computer and use it in GitHub Desktop.
Save JeViCo/8c21c10f701b2a5267fe2908efdba2bf to your computer and use it in GitHub Desktop.
Creating private fork of public repo
  1. Create empty private repo
  2. Bare clone a public repo, and mirror push it to the private repo.
git clone --bare https://github.com/exampleuser/public_repo.git
cd public_repo.git
git push --mirror https://github.com/yourname/private_repo.git
  1. Register remote repository with public repositoryPermalink
git clone https://github.com/yourname/private_repo.git
cd private_repo
git remote add public https://github.com/exampleuser/public_repo.git

Fetching from public repo

git pull public master
git push origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment