Automatically Execute Mistyped Git Commands

I use the command line with Git. I do this because I type faster than I use my mouse. It is a personal preference. Due to this, I sometimes fat finger Git commands. Yeah, it does happen. For example, I can type:

$ git chekcout -b new_branch_name

Notice the checkout command is mistyped (kc instead of ck). I misspell that and branch (usually brnach) often. Git will usually give notice this and give you a suggestion on which command you might have meant.


$ git chekcout -b new_branch
git: 'chekcout' is not a git command. See 'git --help'.

Did you mean this?

There is hope for us misspellers. There is a Git config option called help.autocorrect. “If you set help.autocorrect to 1, Git will automatically run the command if it has only one match under this scenario”.

To set it:

$ git config --global help.autocorrect 1

Then when you misspell again:

$ git chekcout -b new_branch
WARNING: You called a Git command named 'chekcout', which does not exist.
Continuing under the assumption that you meant 'checkout'
in 0.1 seconds automatically...
Switched to a new branch 'new_branch'

Git warns you that it will be making an assumption. That is nice. It just speeds things up and allows me to keep misspelling things. Hardy har har.

Jason Meridth


My name is Jason Meridth. I am a continuously learning senior software developer/devops/team lead/development manager trying to not let best be the enemy of better. I reserve the right to change my mind upon obtaining more information. I am also the owner and principal software consultant at Meridth, LLC. If you have any software, hardward, networking, process, etc needs please don't hesitate to reach out to me.

Raspberry Pi Kubernetes Cluster - Part 2

Howdy again.Alright, my 8 port switch showed up so I was able to connect my raspberry 3B+ boards to my home network. I plugged it in wit...… Continue reading

Raspberry Pi Kubernetes Cluster - Part 1

Published on April 07, 2018

SSH - Too Many Authentication Failures

Published on March 28, 2018