Nest all content into snippets
This commit is contained in:
21
snippets/git/s/switch-to-branch.md
Normal file
21
snippets/git/s/switch-to-branch.md
Normal file
@ -0,0 +1,21 @@
|
||||
---
|
||||
title: Switch to a branch
|
||||
type: snippet
|
||||
language: git
|
||||
tags: [branch]
|
||||
cover: bridge
|
||||
dateModified: 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`
|
||||
```
|
||||
Reference in New Issue
Block a user