Auto-correct git spelling mistakes

chilcutt

Kyle Chilcutt

Posted on May 14, 2019

Auto-correct git spelling mistakes

I use git a lot for both work and personal projects, which means I type a lot of commands each day. git has a built-in spelling auto-correct system for when you’re not quite having the most precise day.

tl;dr auto-correct git spelling mistakes

$ git config --global help.autoCorrect 1

This turns this:

aarrggghhhh

To this:

aww yiss

$ git config --global help.autoCorrect 1

The argument is the number of deciseconds (0.1 sec) to wait before correcting and executing a command and 1 is the shortest possible delay. If only a single option is found it will be executed, if multiple commands could be possible, it will error and ask you to try again:

Combined with a handful of bash aliases for the ways I commonly misspell git and there’s a chance I can get some stuff done without that extra cup of coffee.

$ alias gi='git'
$ alias gti='git'
$ alias gits='git'

I probably accidentally use this git config more than any other…

💖 💪 🙅 🚩
chilcutt
Kyle Chilcutt

Posted on May 14, 2019

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related