Add a note about switching branches

This commit is contained in:
Asocia 2021-06-30 13:24:27 +03:00
parent ff628700ec
commit f667660ffa

View File

@ -41,3 +41,9 @@ $ git fetch pb
```
Pauls master branch is now accessible locally as pb/master — you can merge it into one of your branches, or you can check out a local branch at that point if you want to inspect it.
- Using git switch to create and checkout branches
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 -`.