查看当前push以及fetch的地址

PS F:\Xiang> git remote -v
origin  https://xxx.com/code.git (fetch)
origin  https://xxx.com/code.git (push)

添加新的远程地址

remote set-url --add origin https://yyy.com/code.git

再次查看

PS F:\Xiang> git remote -v
origin  https://xxx.com/code.git (fetch)
origin  https://xxx.com/code.git (push)
origin  https://yyy.com/code.git (push)

push的时候就会同时push到xxx.com 以及 yyy.com


查看.git/confg 文件 ,可看到有两个url

[remote "origin"]
	url = https://xxx.com/code.git
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = https://yyy.com/code.git



参考文档:

https://blog.csdn.net/CXLiao/article/details/105286752