This question shows how to push up to a commit to the master branch (eg all parent commits of the specific commit):
How can I pushing specific commit to a remote, and not the previous commits?
The answer is :
git push <remotename> <commit SHA>:<remotebranchname>
so you can use git push origin <commit SHA>:master
However, I would like to automatically push that commit to the matching remote branch.
I can't just use git push <remotename> "<commit SHA>:$(git branch)"
because git branch returns the local branches, I would like to have the matching remote branch (eg for example you can map the local master branch
to map to the remote prod
branch). I would like to take that into account.