Can I push to more than one repository in a single command in git?

前端 未结 2 2058
盖世英雄少女心
盖世英雄少女心 2021-01-29 21:20

Basically I wanted to do something like git push mybranch to repo1, repo2, repo3

right now I\'m just typing push many times, and if I\'m in a hurry to the t

2条回答
  •  时光说笑
    2021-01-29 22:12

    You can have several URLs per remote in git, even though the git remote command did not appear to expose this last I checked. In .git/config, put something like this:

    [remote "public"]
        url = git@github.com:kch/inheritable_templates.git
        url = kch@homeserver:projects/inheritable_templates.git
    

    Now you can say “git push public” to push to both repos at once.

提交回复
热议问题