git 修改远程仓库地址

2018-05-18  本文已影响3人  和谐共处

方法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)

上一篇 下一篇

猜你喜欢

热点阅读