DEV Community

Discussion on: Git switch command

Collapse
 
jessekphillips profile image
Jesse Phillips

OK, then if I do

git switch -d <commit> -c <branch>

It should work as expected, right?

Collapse
 
m0rozov profile image
Andrey

No, options -d cannot be used with a -c

Collapse
 
jessekphillips profile image
Jesse Phillips

Sad, hard to beat

git checkout -b <branch> <commit>

Thread Thread
 
m0rozov profile image
Andrey

U can use

git switch -c <branch> <commit>