Last active
October 13, 2017 05:32
-
-
Save drmercer/f18ef12c478692ccc99069f98d9c1eaf to your computer and use it in GitHub Desktop.
Put this script somewhere in your $PATH. Then you can type "git gud" for help with the last git command you used
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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