DEV Community

Discussion on: The Git Commands I Use Every Day

Collapse
 
wiseai profile image
Mahmoud Harmouch

Never heard of git switch; Good to know. I am now wondering about the difference between switch and checkout.

Thanks for sharing, BTW! Keep it up!

Collapse
 
netch80 profile image
Valentin Nechayev

"switch" and "restore" are relatively new offsprings from "checkout" (approx. 2 years old). It's not strange that many guides still omit them.

Collapse
 
jessekphillips profile image
Jesse Phillips

Switch is an improved interface from checkout. Have not needed checkout though: git switch --detach , is a bit longer.

For example previous branch: git switch -