Move git repo with git clone --mirror and git push --mirror

你离开我真会死。 提交于 2020-06-26 08:49:09

问题


I have to move a couple of repos from Gitlab to Bitbucket and discovered that the easiest way to do it seems to be:

  1. Create new empty repository in Bitbucket
  2. git clone --mirror git@gitlab.com:path/to/repo.git
  3. cd repo.git
  4. git remote set-url origin git@bitbucket.org:path/to/repo.git
  5. git push --mirror

This seems to copy the entire repo including tags, all branches etc. and I haven't discovered any disadvantages of this method yet. However, as I haven't seen this method anywhere on the internet, I'm afraid I'm missing something.

Can I safely use this method and remove the old repositories afterwards?

来源:https://stackoverflow.com/questions/49387671/move-git-repo-with-git-clone-mirror-and-git-push-mirror

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!