pull/push from multiple remote locations

后端 未结 15 1241
傲寒
傲寒 2020-11-21 10:17

The short: is there a way to have a git repo push to and pull from a list of remote repos (rather than a single \"origin\")?

The long:

15条回答
  •  不思量自难忘°
    2020-11-21 10:25

    I added two separate pushurl to the remote "origin" in the .git congfig file. When I run git push origin "branchName" Then it will run through and push to each url. Not sure if there is an easier way to accomplish this but this works for myself to push to Github source code and to push to My.visualStudio source code at the same time.

    [remote "origin"]
      url = "Main Repo URL"
      fetch = +refs/heads/*:refs/remotes/origin/*
      pushurl = "repo1 URL"
      pushurl = "reop2 URl"
    

提交回复
热议问题