How to create and checkout a git branch in a single command

Often when you cre­ate a new branch, you want to swtich to it immed­i­tately. The usual way to do that is

git branch new-branch-name
git checkout new-branch-name

You can save your­self some key­strokes and com­bine these two com­mands into one

git checkout -b new-branch-name

Ryan Sukale

Ryan is just a regular guy next door trying to manage his life and finances.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *