branch and checkout using a single command

While writing the question, and finding What is the difference between “git branch” and “git checkout -b”? in the list of similar questions, I found the answer myself:

$ git checkout -b new_branch_name

I guess I was reading the man page for the wrong command, I was expecting this as part of the branch command, not for checkout. Quoting the man page for checkout:

Specifying -b causes a new branch to be created as if git-branch(1) were called and then checked out.

Just what I was looking for.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)