Github mirror repository

An easy way to mirror a GitHub repo without forking.

Step to mirror a repo

Create a new repo (private)

Create a bare clone of the repository

git clone --bare https://github.com/exampleuser/old-repository.git

Mirror it

cd old-repository.git
git push --mirror https://github.com/exampleuser/new-repository.git

Remove old clone repo

cd ..
rm -rf old-repository.git

Photo by Remi Moebs on Unsplash