如何将一个Git仓库迁移到另外的Git仓库
一、第一步
把服务器上得所有分支和tag先拉取到本地
-
拉去分支到本地
git branch -a查看所有的分支git checkout branch-name检出指定分支到本地 -
拉去所有的TAG 到本地
git fetch --tags
二、 更换远端资源连接到新的连接
git remote rm origin清除本地和远端的资源连接git remote add origin <url to NEW repo>建立新的连接
三、把本地的资源推到新仓库
git push origin --allgit push --tags

浙公网安备 33010602011771号