Git操作:一份代码同时提交两个Git仓库

前言:最近想把一份代码上传到两个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 [email protected]:xxx/cicd3.git

#再次查看

这个时候查看远端仓库信息会有两个Push的远程仓库 

git remote -v

 

猜你喜欢

转载自blog.csdn.net/fen_fen/article/details/130595691
今日推荐