git本地仓库关联多个远程仓库
从远程仓库克隆:
git clone https://github.com/Byron4j/myBoot.git
添加另外一个远程仓库绑定,并取名为originlocal 。
git remote add originlocal http://localhost:3000/zixiao217/springDataJPA.git
查看当前已经关联的所有仓库:
git remote -vv
# 输出: 表示已经关联了2个仓库了
# origin :https://github.com/Byron4j/myBoot.git
# originlocal :http://localhost:3000/zixiao217/springDataJPA.git
origin https://github.com/Byron4j/myBoot.git (fetch)
origin https://github.com/Byron4j/myBoot.git (push)
originlocal http://localhost:3000/zixiao217/springDataJPA.git (fetch)
originlocal http://localhost:3000/zixiao217/springDataJPA.git (push)
可以通过 git push 关联仓库名
提交代码到指定的远程仓库。
以下命令表示提交到多个远程仓库的其中一个:http://localhost:3000/zixiao217/springDataJPA.git
git push originlocal