- Clone the repo with the
--mirror
flag
git clone --mirror https://<URL>.git
- Create a new repo without initializing it with any files
- Clone this new repo locally
- Add a new remote to the new repo
git remote add new_remote https://<URL>.git
- Push to the new remote
git push --mirror new_remote
- Remove the old remote
git remote rm origin
List all remotes:
git remote -v
Clones pointing to new remote:
git remote set-url origin https://<URL>.git
Renaming remotes:
git remote rename old_name new_name