Skip to content

Instantly share code, notes, and snippets.

@drmercer
Last active Oct 13, 2017
Embed
What would you like to do?
Put this script somewhere in your $PATH. Then you can type "git gud" for help with the last git command you used
#!/bin/bash -i
last_command=$(fc -ln | grep -v 'git gud' | grep -E '^\s*git' | tail -n 1 | cut -d ' ' -f 3)
if [ -n "$last_command" ] ; then
git help "$last_command"
echo "(now ur gud at 'git $last_command')"
else
echo "No recent git command found :("
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment