Autocorrect git commands

If you've been putting off setting up aliases, or just prefer taking the scenic route you've probably spent some time with this kind of response:

git: 'status#' is not a git command. See 'git --help'.

Did you mean this?

The problem is, git does nothing with this suggestion. To make this a little bit more helpful, you can set the help.autocorrect option to do as follows:

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.

For example, setting the value using git config --global help.autocorrect 15 will tell git to wait 1.5 seconds before running the correct command.

WARNING: You called a Git command named 'status#', which does not exist.
Continuing under the assumption that you meant 'status'
in 1.5 seconds automatically...
Posted on Jun 1
Written by Matthew Jewell