Skip to content

Instantly share code, notes, and snippets.

@jacobobryant
Created February 4, 2022 01:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jacobobryant/b53daf1645566a047879c4479cc98129 to your computer and use it in GitHub Desktop.
Save jacobobryant/b53daf1645566a047879c4479cc98129 to your computer and use it in GitHub Desktop.
git dad: improve git's error message

Add this to your .bashrc to improve git's error message for a common typo:

git() {
  if [ "$1" = dad ]; then
    curl -H "Accept: text/plain" https://icanhazdadjoke.com/
    echo
  else
    $(which git) "$@"
  fi
}

Example:

$ git dad .
I wouldn't buy anything with velcro. It's a total rip-off.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment