You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-5Lines changed: 9 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -974,7 +974,9 @@ Some useful aliases include:
974
974
*Some Aliases are taken from [@mathiasbynens](https://github.com/mathiasbynens) dotfiles: https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig*
975
975
976
976
#### Auto-Correct
977
-
If you type `git comit` you will get this:
977
+
Git gives suggestions for misspelled commands and if auto-correct is enabled the command can be fixed and executed automatically. Auto-correct is enabled by specifying an integer which is the delay in tenths of a second before git will run the corrected command. Zero is the default value where no correcting will take place, and a negative value will run the corrected command with no delay.
978
+
979
+
For example, if you type `git comit` you will get this:
978
980
979
981
```bash
980
982
$ git comit -m "Message"
@@ -984,21 +986,23 @@ $ git comit -m "Message"
984
986
# commit
985
987
```
986
988
987
-
To call `commit` when `comit` is typed, just enable auto-correct:
989
+
Auto-correct can be enabled like this (with a 1.5 second delay):
988
990
989
991
```bash
990
-
$ git config --global help.autocorrect 1
992
+
$ git config --global help.autocorrect 15
991
993
```
992
994
993
-
So now you will get this:
995
+
So now the command `git comit`will be auto-corrected to `git commit` like this:
994
996
995
997
```bash
996
998
$ git comit -m "Message"
997
999
# WARNING: You called a Git command named 'comit', which does not exist.
998
1000
# Continuing under the assumption that you meant 'commit'
999
-
# in 0.1 seconds automatically...
1001
+
# in 1.5 seconds automatically...
1000
1002
```
1001
1003
1004
+
The delay before git will rerun the command is so the user has time to abort.
0 commit comments