Last Updated: February 25, 2016
·
1.389K
· rizwaniqbal

Git AutoCorrect

We all make typos, and we all get frustrated correcting them. Git has a nifty inbuilt feature to correct typos. It can either correct it instantly and run the command or will wait for the time period specified.

You just have to change the git config setting:

git config --global help.autocorrect

Alternately, you can pass an argument for time. Example:

git config --global help.autocorrect 5

will make git wait for 0.5 seconds before processing the command.

Example:

$ git fecth
WARNING: You called a Git command named 'fecth', which does not exist.
Continuing under the assumption that you meant 'fetch'
in 0.5 seconds automatically...

Also, if you want to add shorter names for git commands, like br for branch or fe for fetch, you can make changes to your .gitconfig file:

[alias]
    co = checkout
    ci = commit
    rb = rebase
    br = branch
    fe = fetch

3 Responses
Add your response

Yet another vote for coderwall feature "protip already exists" :
https://coderwall.com/p/gvw46q

over 1 year ago ·

@avnerner guess I need to be regular here.... :s

over 1 year ago ·

@avnerner what do you think about this ? https://coderwall.com/p/49izuw

over 1 year ago ·