Is there a way to git push, but, if the branch doesn't exist in the remote, throw an error or exit non-zero instead of creating a new branch on the server?
The use case is the following. I am creating scripts to help automate the scm workflow in my company. If someone accidentally mistypes a branch name as input into the script, I don't want a new branch created on the remote. I already can manually check remote branch existence, but I wondered if git supports this feature.