Mirror a git repo

git clone --bare https://github.com/exampleuser/old-repository.git
# Make a bare clone of the repository

cd old-repository.git
git push --mirror https://github.com/exampleuser/new-repository.git
# Mirror-push to the new repository

cd ..
rm -rf old-repository.git
# Remove our temporary local repository

See here for more.

One thought on “Mirror a git repo

Leave a Reply

Your email address will not be published. Required fields are marked *