Hacker News new | ask | show | jobs
by metrognome 3180 days ago
Quite often, I accidentally press the space bar eagerly when typing git commands:

    $ gi tstatus
To fix this, I've added the following to my .bashrc:

    gi() {
        args=("$@")
        args[0]=${args[0]/t/}
        git "${args[@]}"
    }
It also works if you drop the "t" altogether.
1 comments

Ha! I have almost the same thing:

gi() { ARG=$(echo $1 | sed s/^t//); shift; git "$ARG" "$@"; }