Log Graph in Git
This tutorial will introduce how to graphically view the history of commits in Git using the git log
command.
View Log Graph in Git
The command git log
displays all snapshots(commits)
in the repository’s history all at once. This command has a default function that will show:
- (SHA) Secure Hash Algorithm
- Author
- Date
- Commit message
The flag --graph
attached with the command git log
allows us to view our previous commits as a graph.
git log --graph
We can also combine the flag --oneline
with this command to generate an overview of how commits have merged and how the git history was built.
git log --graph --oneline
How to Graph All Git Branches
To effortlessly go through all the branches in the graph, we can integrate the flag --all
to the git log
command. --decorate
can also be used with this command to see all important information in a well-mannered and beautifully color-coded format.
git log --all --decorate --oneline --graph
Almost every Git user uses these four switches mentioned above as developers need them in their development.
Abdul is a software engineer with an architect background and a passion for full-stack web development with eight years of professional experience in analysis, design, development, implementation, performance tuning, and implementation of business applications.
LinkedIn