You would probably want to do something smarter e.g. run a script which checks whether $? is 127 (the code bash sets when a command is not found) and then checks if running it with git instead would work (e.g. by checking for a command called git-xxx where xxx is the first word of $BASH_COMMAND).