![Forrest logo](/images/logo.png)
git-log:tldr:19594
The command git log --oneline --decorate --all --graph
is used to display a concise, decorated, graphical representation of the commit history in Git. Let's break down the individual options:
-
--oneline
: This option condenses each commit to a single line, showing only the first line of the commit message along with the commit hash. It provides a compact and readable view of the commit log. -
--decorate
: This option adds additional information to the displayed commits. It decorates commits with information such as branch and tag names that point to them, providing context on the commit's relationship to branches and tags. -
--all
: This option includes commits from all branches and remote-tracking branches in the log. It shows the entire commit history of the repository, including commits from branches other than the currently checked out branch. -
--graph
: This option adds a text-based ASCII art representation of the commit graph. It visually represents the branching and merging of commits, giving a clear overview of the commit history. The lines between commits depict their relationships, making it easier to understand the branching structure.
Combining these options, git log --oneline --decorate --all --graph
produces a visually appealing representation of the commit history showing branch names, commit hashes, commit messages, and the relationships between commits through a graph.