diff --git a/book/03-git-branching/sections/nutshell.asc b/book/03-git-branching/sections/nutshell.asc index 43461b17f..3818d939a 100644 --- a/book/03-git-branching/sections/nutshell.asc +++ b/book/03-git-branching/sections/nutshell.asc @@ -198,3 +198,12 @@ Let's see why you should do so. ==== It's typical to create a new branch and want to switch to that new branch at the same time -- this can be done in one operation with `git checkout -b `. ==== + +[NOTE] +==== +From Git version 2.23 onwards you can use `git switch` instead of `git checkout` to: + +- Switch to an existing branch: `git switch testing-branch`. +- Create a new branch and switch to it: `git switch -c new-branch`. The `-c` flag stands for create, you can also use the full flag: `--create`. +- Return to your previously checked out branch: `git switch -`. +====