Skip to content

Commit

Permalink
Add an example to display both local and remote branches
Browse files Browse the repository at this point in the history
  • Loading branch information
shillpi committed Oct 20, 2023
1 parent 1e68f74 commit c2cb7bd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions content/snippets/git/s/view-all-branches.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,25 @@ dateModified: 2021-04-13
Prints a list of all local branches.

- Use `git branch` to display a list of all local branches.
- Use `git branch -a` to display both remote and local branches.
- Use arrow keys to navigate, press <kbd>Q</kbd> to exit.

```shell
git branch
git branch -a
```

```shell
git branch
# master
# patch-1
# patch-2

git branch -a
# master
# patch-1
# patch-2
# remotes/origin/master
# remotes/origin/patch-1
# remotes/origin/patch-2
```

0 comments on commit c2cb7bd

Please sign in to comment.