Mac Updates keep removing git, so I made this:
Add this to your .zprofile and it will automatically check if git is installed and ask to install it if it isn't when you start a new zsh session.
if [[ "$(git -v 2>&1)" == *"error: invalid active developer path"* ]]; then
echo "git missing. installing Command Line Tools"
xcode-select --install
fi