I have a local repo and it has some branches, e.g. branch1
, branch2
..
I want to push the branches to different remote repos, how?
I have a local repo and it has some branches, e.g. branch1
, branch2
..
I want to push the branches to different remote repos, how?
Simply
git push https://repo.one/there branch1
git push https://repo.two/elsewhere branch2
If you want to shorten your commands, you can predefine the remote destinations:
git remote add one https://repo.one/there
git remote add two https://repo.two/elsewhere
Then the commands can be shortened to
git push one branch1
git push two branch2
You can also set the default push destinations:
git branch --set-upstream-to=one/branch1 branch1
git branch --set-upstream-to=two/branch2 branch2