ahmedjama.com
JD

How to duplicate a Git repo

ยท Below 1 min read
How to duplicate a Git repo

Sometimes you will want duplicate a repository without forking it. The process from was taken from the GitHub documentation pages at https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/duplicating-a-repository.

Linux/Mac

Open up terminal.

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

$ cd old-repository.git

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

$ cd ..

$ rm -rf old-repository.git
Share: