How to check if a remote branch exists

git ls-remote --heads origin feature/KLAPP-237-add-mac-build-slaves-to-git1