Git 切换-本地项目到一个空仓库

 Administrator@Ken-PC MINGW64 /c/MyCode/LanChuan
$ cd game-data/ # 切换目录
Administrator@Ken-PC MINGW64 /c/MyCode/LanChuan/game-data (master)
$ git remote -v # 显示所有远程仓库地址
origin git@192.168.1.250:php/game-data.git (fetch)
origin git@192.168.1.250:php/game-data.git (push)
Administrator@Ken-PC MINGW64 /c/MyCode/LanChuan/game-data (master)
$ git remote rename origin old-origin # 重命名地坛
Administrator@Ken-PC MINGW64 /c/MyCode/LanChuan/game-data (master)
$ git remote add origin git@120.*.*.*:game_bg/game-data.git # 添加新地址
Administrator@Ken-PC MINGW64 /c/MyCode/LanChuan/game-data (master)
$ git push -u origin --all # 推送到仓库
/** 最后一句会出现类似以下的信息,表示成功
Branch 'dev' set up to track remote branch 'dev' from 'origin'.
Branch 'master' set up to track remote branch 'master' from 'origin'.
*/
Administrator@Ken-PC MINGW64 /c/MyCode/LanChuan/game-data (master)
$ git push -u origin --tags # 推送所有分支的Tags
Everything up-to-date
Administrator@Ken-PC MINGW64 /c/MyCode/LanChuan/game-data (master)
$ git remote -v # 显示当前仓库的地址
old-origin git@192.168.1.250:php/game-data.git (fetch)
old-origin git@192.168.1.250:php/game-data.git (push)
origin git@120.77.17.83:game_bg/game-data.git (fetch)
origin git@120.77.17.83:game_bg/game-data.git (push)
Administrator@Ken-PC MINGW64 /c/MyCode/LanChuan/game-data (master)
$ git pull
Already up to date.
Administrator@Ken-PC MINGW64 /c/MyCode/LanChuan/game-data (master)
$ git push
Everything up-to-date

根据以上操作就能完成