which git &> /dev/null || { echo >&2 "I require git but it's not installed. Aborting."; exit 1; }
echo "Git is installed."
That will echo "Git is installed" if it is, otherwise, it'll echo an error message. You can use this for scripts that use git
It's also customizable, so you can change "which git" to "which java" or something, and change the error message.