check if commit exists in branch git code example Example: git check if commit in master git branch --contains $COMMIT_ID