git – duplicate a repo without forking

mkdir foo; cd foo 
# move to a scratch dir

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
https://stackoverflow.com/questions/6613166/how-to-duplicate-a-git-repository-without-forking

Published by Bojan Bjelić

Working hard on bunch of stuff, positive future above all. I'm blogging mostly about software, productivity and digital world.

Leave a comment

Leave a Reply

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