Files
30-seconds-of-code/snippets/switch-to-branch.md
Isabelle Viktoria Maciohsek ee28929328 Make expertise a field
2022-03-01 20:23:46 +02:00

21 lines
428 B
Markdown

---
title: Switch to a branch
tags: branch
expertise: beginner
firstSeen: 2021-04-04T14:09:09+03:00
lastUpdated: 2021-04-13T21:10:59+03:00
---
Switches to an existing branch.
- Use `git checkout <branch>` to switch to the specified branch.
- Note: In newer versions of git, you can also use `git switch <branch>`.
```shell
git checkout <branch>
```
```shell
git checkout patch-1 # Switches to the branch named `patch-1`
```