Git仓库迁移

506 阅读1分钟

方式1

打开 Terminal(终端)。 创建仓库的裸克隆。

$ git clone --bare https://github.com/exampleuser/old-repository.git

镜像推送至新仓库。

$ cd old-repository.git
$ git push --mirror https://github.com/exampleuser/new-repository.git

删除您之前创建的临时本地仓库。

$ cd ..
$ rm -rf old-repository.git

方式2

git push --set-upstream w_origin