Is there a way to get git commands to autocomplete commands based on the shorthand version?

When working for another company, I used Mercurial a lot for version control. I really like git

it better, but one thing that really annoys me is that in Mercurial if I type:

hg stat

      

It's smart enough to figure out that the only command that could have been instead is hg status

, so doing that command is for me.

I know I do git

n't do this by default, but I'd like to. (BTW, I read http://www.evanjones.ca/git-shortcuts.html and know about aliases, but I don't have to set up an alias every time I want this behavior.)

I could write an addon for git

that does this, but first I'm wondering if there is a way to tweak git

to recognize this behavior that I want, and if not, is there already a plugin for this?

+3


source to share


2 answers


Git Bash performs command autocompletion when TAB is pressed. If there is more than one parameter for the prefix you entered, pressing TAB twice displays all parameters. It even auto-completes the branch names.



git stat

will be completed before git status

when you press TAB.

+1


source


You said that you don't want to set up aliases, but there are many ready-made lists that you can copy / paste into your config. This is one such example.



0


source







All Articles