When I'm on master, I only have to type 'git push' to push commits to the remote repo. I wish I could do so when I'm on another branch, without specifying the remote name and the branch name. Like that:
Now: git push origin experimental:origin/experimental
Need: git push
Warning: force pushing will overwrite the remote branch with the state of the branch that you're pushing. Make sure that this is what you really want to do before you use it, otherwise you may overwrite commits that you actually want to keep.
The Error Message The error: failed to push some refs to remote git error occurs when new changes are pushed to the repository on version control not yet made it to your local repository. This could happen when you are working with someone on one project and simultaneously push to a branch.
The objective is to push to multiple Git remotes with a single git push command. If you don't want to create an extra remote named all , you can skip the first command and use the remote origin instead of all in the subsequent command(s). Now, you can push to all remote repositories with a single command!
You should edit your .git/config
file. There should be already set something like this:
[branch "master"]
remote = origin
merge = refs/heads/master
Simply copy the group and edit according to your needs. For example, you could have:
[branch "master"]
remote = origin
merge = refs/heads/master
[branch "experimental"]
remote = origin
merge = refs/heads/experimental
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