Skip to content

Instantly share code, notes, and snippets.

@JeViCo
Last active August 19, 2023 18:33
Show Gist options
  • 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