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.

Answer from MvG on Stack Overflow
🌐
ShellHacks
shellhacks.com › home › git – create new branch and checkout – in one command
Git - Create New Branch and Checkout - In One Command - ShellHacks
July 4, 2019 - First, you would have to move to develop if you haven’t already. Once you are in develop, you just need to use the commands above to create the new feature branch. In case I haven’t explained myself clear enough, this would be the steps starting in master: git checkout -b develop git checkout ...
Discussions

fetch and checkout a remote git branch in just one command - Stack Overflow
If I have local repo with a remote $REMOTE already set up and a new branch $BRANCH exists on the remote repo that I haven't fetched, yet can I fetch that branch and check it out into a tracking l... More on stackoverflow.com
🌐 stackoverflow.com
git clone and checkout in a single command - Stack Overflow
The following is the command I use to checkout a specific commit. git clone git://repo.git/repo123 git checkout I want to do the above in one step - using a git clone command only... More on stackoverflow.com
🌐 stackoverflow.com
git checkout and merge in one command - Stack Overflow
I just wanted to see if there was ... a single command. ... In the scenario you describe you can do git checkout -B master. It performs a reset instead of a (fast-forward) merge, but that's safe since you did a rebase master first. This solution is also mentioned in an alternative answer to the one you linked to. ... That is a neat idea - saves one step. Thanks. ... Save this answer. ... Show activity on this post. If your branch names are ... More on stackoverflow.com
🌐 stackoverflow.com
How do i create a Branch using the terminal in VS Code?
To enter this new branch, you can also type git checkout name_of_the_branch. Hope I helped! ... There was an error while loading. Please reload this page. Something went wrong. There was an error while loading. Please reload this page. ... There was an error while loading. Please reload this page. Something went wrong. There was an error while loading. Please reload this page. ... For anyone interested, you can achieve the same result with only one command... More on github.com
🌐 github.com
2
1
🌐
Jessica Temporal
jtemporal.com › creating-a-new-branch-and-switching-to-it-with-only-one-command
Creating a new branch and switching to it with just one command | Jessica Temporal
June 20, 2026 - To create a new branch and switch to it in one command, you have two options: git checkout -b branch-name or git switch -c branch-name. Both create the branch and move you onto it right away, so you can start committing.
🌐
GeeksforGeeks
geeksforgeeks.org › git › git-checkout-branch
Git Checkout Branch - GeeksforGeeks
February 26, 2026 - Use the git checkout command followed by the branch name to switch to the desired branch. ... This method combines the creation of a branch with switching to it in a single operation, it is useful in order to begin work on a new feature or bug ...
🌐
Git
git-scm.com › docs › git-checkout
Git - git-checkout Documentation
Restore a different version of a file, for example with git checkout <commit> <filename> or git checkout <filename> See ARGUMENT DISAMBIGUATION below for how Git decides which one to do. ... Switch to <branch>. This sets the current branch to <branch> and updates the files in your working directory.
🌐
Atlassian
atlassian.com › git › tutorials › using branches › git checkout
Git Checkout | Atlassian Git Tutorial
The git checkout command lets you navigate between the branches created by git branch. Checking out a branch updates the files in the working directory to match the version stored in that branch, and it tells Git to record all new commits on that branch.
🌐
YouTube
youtube.com › watch
Git Branch Create and Checkout in one Command Example - YouTube
Looking for that one command to create and checkout a Git branch? Well, here's a quick example of how to do exactly that. It's the checkout command with the ...
Published   October 2, 2021
Find elsewhere
🌐
Bluebirrrrd
bluebirrrrd.com › blog › how-to-find-a-git-branch-and-check-it-out-in-one-command
How to find a git branch and check it out in one command | Blog
We're doing a git checkout command and pass the result of whatever is in $() as a parameter. In the parentheses, we list all the branches of a current repo using git branch, and then pass that output into a grep command to search within.
🌐
Linux Hint
linuxhint.com › create-branch-and-checkout-using-a-single-command
How to Create Branch and Checkout Using a Single Command – Linux Hint
Then, run the “git checkout -b <branch-name>” command. Another way to generate and redirect to branches is the “git switch -c <branch-name>” command.
🌐
Refine
refine.dev › home › blog › alternatives › git switch and git checkout – how to switch branches in git
git switch and git checkout – How to switch branches in git | Refine
July 4, 2025 - To create and switch to a new branch in one command, use git checkout -b new_branch. For remote branches, first fetch the branch using git fetch --all, then switch using git checkout remote_branch_name.
🌐
Git
git-scm.com › book › en › v2 › Git-Branching-Basic-Branching-and-Merging
Git - Basic Branching and Merging
You’ve decided that you’re going to work on issue #53 in whatever issue-tracking system your company uses. To create a new branch and switch to it at the same time, you can run the git checkout command with the -b switch:
🌐
Git Tower
git-tower.com › learn › git faq › git checkout & switch: how to change branches
Git Checkout & Switch: How to Change Branches | Learn Version Control with Git
1 week ago - Both commands can switch and create branches, but they differ in scope: The key advantage of git switch is clarity: it only handles branch operations, reducing the risk of accidentally overwriting files when you meant to switch branches.
🌐
tutorialpedia
tutorialpedia.org › blog › branch-and-checkout-using-a-single-command
How to Create and Switch Git Branches with a Single Command (No More Forgetting 'git checkout') — tutorialpedia.org
Enter Git’s modern branch management commands: `git switch` and `git restore`. Introduced in Git 2.23 (released in 2019), these commands split the overloaded functionality of `git checkout` into two ...
🌐
CoreUI
coreui.io › answers › how-to-checkout-a-branch-in-git
How to checkout a branch in Git · CoreUI
November 17, 2025 - Both commands provide safe branch switching with proper working directory updates. Use git checkout branch-name or git switch branch-name to change to an existing branch. # Checkout an existing branch (traditional method) git checkout feature-branch ...
🌐
freeCodeCamp
freecodecamp.org › news › git-checkout-explained
Git Checkout Explained: How to Checkout, Change, or Switch a Branch in Git
December 31, 2019 - This is equivalent to running git branch with -f. You can pass the -f or --force option with the git checkout command to force Git to switch branches, even if you have un-staged changes (in other words, the index of the working tree differs ...
🌐
GoLinuxCloud
golinuxcloud.com › home › devops › git › git checkout command explained (branch, commit, file examples)
Git Checkout Command Explained (Branch, Commit, File Examples) | GoLinuxCloud
March 16, 2026 - It updates the HEAD pointer and working directory to match the selected branch or commit. You can switch to an existing branch using git checkout branch-name. To create and switch to a new branch in one command, use git checkout -b new-branch.