DEV Community

Kyle Chilcutt
Kyle Chilcutt

Posted on • Originally published at blog.chilcutt.com on

2 1

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…

AWS GenAI LIVE image

How is generative AI increasing efficiency?

Join AWS GenAI LIVE! to find out how gen AI is reshaping productivity, streamlining processes, and driving innovation.

Learn more

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More