美文网首页
git 修改远程仓库地址

git 修改远程仓库地址

作者: 和谐共处 | 来源:发表于2018-05-18 14:39 被阅读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)
    
    

    相关文章

      网友评论

          本文标题:git 修改远程仓库地址

          本文链接:https://www.haomeiwen.com/subject/pmegdftx.html