Skip to main content

How to duplicate a GitHub repository

· One min read
CTO

There is no simple way to duplicate a GitHub repository in your GitHub account.

But there is a fairly straight forward on how to do it from the command line.

How to duplicate a GitHub repository

First, clone the repo you want to duplicate from your GitHub account

git clone --bare https://github.com/magician11/ai-abraham.git

enter that directory

cd ai-abraham.git

Create your new repo in GitHub, and note the repo URL for it.

Then push this repository contents back to that new repo

git push --mirror https://github.com/magician11/ai-council-of-collective-consciousness.git

You can then remove the bare cloned repo

cd ..

rm -rf ai-abraham.git

And the finally clone that new repo onto your computer to continue to work as per normal..

git clone https://github.com/magician11/ai-council-of-collective-consciousness.git

🥳