Sometimes the need arises to migrate to another git provider.
Here is a quick and safe way to do it:
1 . Create a new empty repository to the git provider of your choice.
- From the root of your local Hugo project remove the origin ref
git remote rm origin
- Add the new origin of the empty repo created in step 1.
git remote add origin <new-repo>
- Transfer everything to the new remote including all of the repo’s history with the
--mirror
flag
git push --mirror origin
- If you wish to delete your repo or even your entire account from the previous git provider now it’s safe to do just that.
P.S. I am sharing the above in light of GitLab’s announcement regarding the mandatory enforcement of telemetry for hosted repositories.