With new versions of git new commands have been added which I will probably never use.
Is there a way I can disable these commands so that I my tab completion is faster?
For ex: before, git check<tab>
would autocomplete to git checkout
But now git check<tab>
doesn't tab complete due to there being git check-mailmap
in the newer git version.
This is just one of the example.
Alternatively it would be great if I could "force" git to tab-complete "check" to checkout
.
Edit: I use vanilla bash with no extra modifications
If you are using the git cli directly, pressing q in the keyboard will also do the job for you. Show activity on this post. ctrl + c is the most used task killing command for command based working windows.
To exit from bash type exit and press ENTER . If your shell prompt is > you may have typed ' or " , to specify a string, as part of a shell command but have not typed another ' or " to close the string. To interrupt the current command press CTRL-C .
Git stores all global configurations in . gitconfig file, which is located in your home directory. To set these configuration values as global, add the --global option, and if you omit --global option, then your configurations are specific for the current Git repository. You can also set up system wide configuration.
The official way is to use the configuration completion.commands
and remove the ones you don't want:
git config --global completion.commands -check-mailmap
However, you can do even more. There is a hack in __git_main()
used for testing that you can abuse to do what you want:
GIT_TESTING_PORCELAIN_COMMAND_LIST="$(git --list-cmds=list-mainporcelain,alias)"
This will force Git's completion to show only the main commands (and aliases).
You need Git v2.18 or newer for these to work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With