I have cloned my repo and would like to push all my remote branches (origin/*) to a new remote which I configured. I have tried:
git push anotherRemote --all
but it only pushes the ones that I made a local copy from. When I type:
git branch -r
I see all the branches located on my other remote (which I have not created local copies of). How to I push those to my anotherRemote
?
Simply specify explicitly what you want to push where:
git push anotherRemote refs/remotes/origin/*:refs/heads/*
This will take all remote branches of origin and push them as normal branches on the other remote. (Verify with git fetch anotherRemote; git branch -rv
.)
Beware of the --mirror
option unless you really understand what it does!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With