Git - Duplicating or Renaming a Repository

By Jack Szwergold • September 15, 2015

How to duplicate and rename a repository.

First step is to create a new repo on GitHub.

Make a bare clone of the source repository.

git clone --bare --recursive git@github.com:JackSzwergold/Memories.git

Go into that directory.

cd Memories.git

Now push (via mirror) into the new repo.

git push --mirror git@github.com:JackSzwergold/Writing.git

If any git clone copies s of the repo exist somewhere, change the origin URL this way.

git remote set-url origin git@github.com:JackSzwergold/Writing.git