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
Written by Rizwan Iqbal
Related protips
3 Responses
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
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Autocorrect
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#