git项目要迁移, 远程地址改成新的地址,通过查询发现有三个方法可以实现 。 如下:
(1)通过命令直接修改远程仓库地址
1 git remote 查看所有远程仓库
2 git remote xxx 查看指定远程仓库地址
3 git remote set-url origin 你新的远程仓库地址
(2)先删除在添加你的远程仓库
1 git remote rm origin
2 git remote add origin 你的新远程仓库地址
(3)修改本地 .git 配置文件
// 切到 .git 目录下,用vi进行修改 git 地址即可
vi config
修改完wq保存退出。