方法1
//查看
$ git remote
origin
//两步操作
//1. git remote remove origin
//2. git remote add origin new_url
$ git remote remove origin http://192.168.18.100/hhq/SolarWallet.git
$ git remote add origin http://172.100.0.110/hhq/SolarWallet.git
//再次查看,远程地址已经修改
$ git remote -v
origin http://172.100.0.110/hhq/SolarWallet.git (fetch)
origin http://172.100.0.110/hhq/SolarWallet.git (push)
方法2
//查看
$ git remote -v
origin http://192.168.18.100/hhq/SolarWallet.git (fetch)
origin http://192.168.18.100/hhq/SolarWallet.git (push)
//修改 git remote set-url origin new_url old_url
$ git remote set-url origin http://172.100.0.110/hhq/SolarWallet.git http://192.168.18.100/hhq/SolarWallet.git
//再次查看,远程地址已经修改
$ git remote -v
origin http://172.100.0.110/hhq/SolarWallet.git (fetch)
origin http://172.100.0.110/hhq/SolarWallet.git (push)
网友评论