Git Autocorrect Typos
I'm sure you have mispelled some git command before and seem an error message similar to the following one:
git: 'idff' is not a git command. See 'git --help'.
Did you mean this?
diff
The message is pretty tantalizing, it knows what I meant why don't apply the correct command?
Turns out there is a git config
option to handle this scneario, but very well hidden down the man page:
$ man git-config
...
help.autoCorrect
Automatically correct and execute mistyped commands after waiting
for the given number of deciseconds (0.1 sec). If more than one
command can be deduced from the entered text, nothing will be
executed. If the value of this option is negative, the corrected
command will be executed immediately. If the value is 0 - the
command will be just shown but not executed. This is the default.
To set auto correct:
$ git config --global help.autoCorrect -1