I type
git puhs
And git says:
kristian@office:~/myrepo$ git puhs
git: \'puhs\' is not a git command. See \'git --help\'
Did y
The autocorrect is nice, but my OCD-self needs a little more control over what's going on. So, I wrote a straightforward script that just chooses the first suggestion provided by git. You run the script after the failed command and use the built in bash history substitution "bang bang" syntax. Also, if you are typing something that could possibly have more than one command, this command lets you choose one other than the first option.
It would look something like this,
kristian@office:~/myrepo$ git puhs
git: 'puhs' is not a git command. See 'git --help'
Did you mean this?
push
kristian@office:~/myrepo$ idid !!
Counting objects: 18, done.
Delta compression using up to 32 threads.
Compressing objects: 100% (10/10), done.
Writing objects: 100% (10/10), 1.17 KiB, done.
Total 10 (delta 6), reused 0 (delta 0)
Plus, it's fun to type anything with two exclamation points. So bonus for that.
Here's a gist with my script