- Clone the repo with the
--mirrorflag
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 originList all remotes:
git remote -vClones pointing to new remote:
git remote set-url origin https://<URL>.gitRenaming remotes:
git remote rename old_name new_name