git修改远程仓库地址

  • git修改远程仓库地址的三种方法
    • 直接命令修改
   git remote set-url origin [url]
   命令,先删除后设新地址
   git remote rm origin 
   git remote add origin [url]
    • 直接修改配置文件 文件位置:git/config
   [core]
    repositoryformatversion = 0
    filemode = false
    bare = false
    logallrefupdates = true
    symlinks = false
    ignorecase = true
    [gui]
        wmstate = normal
        geometry = 841x483+225+101 189 218
    [remote "origin"]
        url = git@github.com:zengmianhui/android_project.git
        fetch = +refs/heads/*:refs/remotes/origin/*
    [branch "master"]
        remote = origin
        merge = refs/heads/master
    • git命令
    git branch --set-upstream-to=origin/master
鲁ICP备16017569号-2