git – duplicate a repo without forking

mkdir foo; cd foo 
# move to a scratch dir

git clone --bare
# Make a bare clone of the repository

cd old-repository.git
git push --mirror
# Mirror-push to the new repository

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

Published by Bojan Bjelić

Working hard on a positive future. Posting about systems, productivity, digital world. Making processing sketches for a hobby.

Leave a comment

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.