Able to push to all git remotes with the one command?

前端 未结 6 1499
广开言路
广开言路 2020-11-30 16:10

Instead of doing:

git push origin --all && git push nodester --all && git push duostack --all

Is there a way to do that wit

6条回答
  •  不知归路
    2020-11-30 16:31

    Create an all remote with several repo URLs to its name:

    git remote add all origin-host:path/proj.git
    git remote set-url --add all nodester-host:path/proj.git
    git remote set-url --add all duostack-host:path/proj.git
    

    Then just git push all --all.


    This is how it looks in .git/config:

      [remote "all"]
      url = origin-host:path/proj.git
      url = nodester-host:path/proj.git
      url = duostack-host:path/proj.git
    

提交回复
热议问题