DEV Community

Quickly switching between branches

Dzhavat Ushev on July 23, 2019

This post was originally posted on my blog. It seems like my post from yesterday about getting productive with git checkout resonated with a lo...
Collapse
 
bradtaniguchi profile image
Brad

this "back-button" command also works for changing directories:

cd - 

(I actually learned the git version 2nd by just trying it out one day hehe)

Collapse
 
ai7ch profile image
Aitch

recently I have come to learn this, seen it my lead-dev doing it... Maybe he doesn't know that we can also use it in git. I might gonna show off :D:D.

Collapse
 
michaelbrooks profile image
Michael Brooks

Ah you found this too, I posted about this a while ago and it's super helpful.

michaelbrooks.co.uk/most-helpful-g...

Collapse
 
dzhavat profile image
Dzhavat Ushev

Yes, it is. Didn‘t know that - works with other commands as well! Will definitely give it a try.

Nice post btw. We even give the same new-feature as example :D

Collapse
 
nikoheikkila profile image
Niko Heikkilä

As a bonus, using Fish shell you can type git checkout <TAB> to scroll through branches and pick them with Enter. This might work with ZSH as well, but I haven't tested it.

Collapse
 
dzhavat profile image
Dzhavat Ushev

Oh, that can be quite convenient. Thanks for sharing it :)

Collapse
 
mvoloskov profile image
Miloslav 🏳️‍🌈 🦋 Voloskov

Wow! Didn't knew that!

Collapse
 
adam_cyclones profile image
Adam Crockett 🌀

Love it!