Created
April 14, 2015 10:11
-
-
Save v01pe/9dfca3cef90b8bb8608b to your computer and use it in GitHub Desktop.
Using git on the command line, but tired of typing `git` in front of every command? Use this little script.
This file contains hidden or 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 | |
lastcmd="" | |
while [ true ]; do | |
read -r -e -p "> git " gitcmd | |
if [ "$gitcmd" != "" ] && [ "$gitcmd" != "$lastcmd" ]; then | |
lastcmd=$gitcmd | |
history -s "$gitcmd" | |
fi | |
if [ "$gitcmd" == "exit" ]; then | |
break | |
elif [ "$gitcmd" == "history" ]; then | |
history | |
elif [ "$gitcmd" != "" ]; then | |
eval git $gitcmd | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment