Git - Duplicate a repository

author: Paul Kim

categories: git

tags: git

Duplicate a repository

I recently renamed one of my repositories on GitHub from paul-kim to paulkode:

  1. Create a new repository on GitHub called paulkode.
  2. Duplicate paul-kim to paulkode:
# create a bare clone of the old repo
git clone --bare
# mirror-push to the new repo
cd paul-kim.git
git push --mirror
# remove the temporary local repo you created
cd ..
rm -rf paul-kim.git

Duplicating a repository


© 2021 All rights reserved.