Skip to content

Commit 497eecf

Browse files
Merge pull request #34 from devinekask/update/checkout-to-switch
Replace 'git checkout' with 'git switch' for branch navigation consis…
2 parents e4cd3c0 + f661e03 commit 497eecf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/content/docs/git/basics/git-06-branches.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,18 @@ Get an overview of all the branches
2828
git branch
2929
```
3030

31-
Now that we have created a new `develop` branch, we can switch to it by running `git checkout develop`:
31+
Now that we have created a new `develop` branch, we can switch to it by running `git switch develop`:
3232

3333
```bash
34-
git checkout develop
34+
git switch develop
3535
```
3636

3737
Make some commits on the `develop` branch.
3838

3939
We would now like to merge our code from `develop` with our `main` code, so that both branches contain the same code (now `develop` has more commits than `main`, i.e. `develop` stands before `main`). For this we first have to switch back to our `main` branch and merge `develop` into it in a next step:
4040

4141
```bash
42-
git checkout main
42+
git switch main
4343
```
4444

4545
The merge of `develop` in `main` is done by the `git merge` command:
@@ -51,7 +51,7 @@ git merge develop main
5151
Switch back to `develop` immediately, so you don't accidentally develop in the `main` branch (we want our `develop` branch to always have the most recent code):
5252

5353
```bash
54-
git checkout develop
54+
git switch develop
5555
```
5656

5757
## Master/main

0 commit comments

Comments
 (0)