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

Often when you create a new branch, you want to swtich to it immeditately. The usual way to do that is

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

You can save yourself some keystrokes and combine these two commands 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 *