前言:最近想把一份代码上传到两个git仓库,用到正好分享
#查看Git仓库
首先查看Git代码绑定了哪些Git仓库
git remote -v
#添加远程仓库地址
git remote add orgin http://git.xx.com/xxx/cicd3.git
#绑定多个远端仓库
之后再绑定另外一个远端仓库,使Push的时候能同时Push两个仓库
git remote set-url --add origin git@git.code.xxx.com:xxx/cicd3.git
#再次查看
这个时候查看远端仓库信息会有两个Push的远程仓库
git remote -v