snippetjavascriptTip
View a visual graph of the Git repository
Viewed 0 times
graphrepositoryviewgitthevisual
Problem
If you're more of a visual person, you can view a graph of all commits and branches in the repository using a single Git command.
Running
Running
git log --pretty=oneline --graph --decorate --all prints a visual graph of the whole repository's history. This command displays a visual representation of all commits and branches in the repository. You can then use the arrow keys to navigate, or press <kbd>Q</kbd> to exit.Solution
# Syntax: git log --pretty=oneline --graph --decorate --all
git log --pretty=oneline --graph --decorate --all
# * 3050fc0de Fix network bug
# * c191f90c7 Initial commitCode Snippets
# Syntax: git log --pretty=oneline --graph --decorate --all
git log --pretty=oneline --graph --decorate --all
# * 3050fc0de Fix network bug
# * c191f90c7 Initial commitContext
From 30-seconds-of-code: view-commit-graph
Revisions (0)
No revisions yet.