amgfna
Last Updated: February 25, 2016
·
1.09K
· rizwaniqbal
605ae30a9f9b68da5ccdd86a5a296f75

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
Say Thanks
Respond

3 Responses
Add your response

1277

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

over 1 year ago ·
1278
605ae30a9f9b68da5ccdd86a5a296f75

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

over 1 year ago ·
1279
605ae30a9f9b68da5ccdd86a5a296f75

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

over 1 year ago ·
Filed Under