直接通过git remote set-url --add origin
添加即可:
itaken@itaken-home:~/path/to/project$ git remote set-url --add origin https://gitee.com/itaken/itaken.git
查看项目的仓库信息:
itaken@itaken-home:~/path/to/project$ git remote -v
origin https://github.com/itaken/itaken.github.io.git (fetch)
origin https://github.com/itaken/itaken.github.io.git (push)
origin https://gitee.com/itaken/itaken.git (push)
如果要删除某个远程地址,则只能全部删除,再单独添加
itaken@itaken-home:~/path/to/project$ git remote rm origin
itaken@itaken-home:~/path/to/project$ git remote -v
itaken@itaken-home:~/path/to/project$ git remote add origin https://github.com/itaken/itaken.github.io.git
itaken@itaken-home:~/path/to/project$ git remote -v
origin https://github.com/itaken/itaken.github.io.git (fetch)
origin https://github.com/itaken/itaken.github.io.git (push)