Last Updated: May 15, 2019
· socjopata

Some cool stuff you should know about git #2

Here is some cool stuff you should know about git (also please check my other protips for more):

Let the git guess what you meant, by...

Are you tired of git complaining about your typos? How many times a day you see something like:

git: 'checout' is not a git command. See 'git --help'  
Did you mean this?

Well, you can actually tell git to do something about its smartypants assumptions. Here is a line you should execute in your shell:
git config --global help.autocorrect 1

Easy switching between two branches

When you work in a Unix environment, sometimes you switch between two directories a lot, using a handy shortcut cd -. Wouldn't it be handy to have something similar for git? Because typying branch names over and over while doing checkout is annoying, right?

If so, you should be delighted to hear that git has a similar command to cd -. Next time, just type: git checkout -

4 Responses
Add your response

git checkout - is awesome! Very nice tip.
As for crorecting your txet, you shouldn't be so lzazzy.

over 1 year ago ·

Nice, I want more!

over 1 year ago ·

You are welcome guys. @ablemike, being "lazy" there means I can be productive elsewhere, if you know what I mean :)

over 1 year ago ·

git co -, it's great!

over 1 year ago ·