Is it possible to push the current commit to a different custom remote branch? I am asking for the equivalent of this exact command:
git push origin HEAD:refs/for/master
This is very useful when working with Gerrit for example: https://gerrit-review.googlesource.com/Documentation/user-upload.html#push_create . This command is used every time you want to push a new commit or fix an existing one.
Note: The refs/for/master
is not a branch you can checkout; it’s a “magical” (like Gerrit docs says) recipient to send new commits to.