git log
The Git command that lists commits with their identifiers, authors, times and messages.
In more detail
Plain git log shows each commit's ID, author, date and message. Flags shape it: --oneline for one line per commit, -n or a number such as -2 to limit how many, --graph to draw branches, --stat or --patch to show what changed, and -- path to show only commits touching a file. Filters such as --since, --author and --grep narrow the list further.
Examples
git log --pretty=format:'%h %ct' > commits.txtgit -C fixture log --format='%ad %s' --date=short -3git -C fixture log --grep=Remediates --format='%s'git log --oneline -- parser.pyRelated terms
- commit — A saved snapshot of the whole project in Git, together with its author, committer, time, message and a pointer to the commit before it.
- deployment log — A file the deploy job appends one line to per deployment, holding the time, the commit and the result.
- change lead time — The time from a commit being made to that commit running in production.
- Git — A free, open-source distributed version control system that records the history of a project as a chain of snapshots.
- commit trailer — A structured "Key: value" line at the end of a commit message that tools can read.
- --oneline — A flag for git log and git show that prints each commit on one line: its abbreviated ID and its subject.
- pretty format — The git log and git show option (--format or --pretty) that sets exactly which fields each commit prints, using placeholders such as %h, %an and %s.
- commit limiting — git log options that keep only the commits you ask about, by count, date, author or words in the message.
- pickaxe — A git log search, -S followed by a string, that finds commits which changed how many times that string appears in the code.
- commit graph — The shape Git's history really has: commits joined by parent links, which branch apart and join again at merges, never forming a loop.
- git show — The command that displays one object in full, usually a commit with its message and patch, or a file as it was in a given commit.
Taught in
- DORA Metrics: Measuring Your Pipeline — Continuous Integration & Continuous Delivery Pipelines
- Throughput: Change Lead Time And Deployment Frequency — DevOps & Site Reliability Engineering
- Instability: Change Fail Rate And Deployment Rework Rate — DevOps & Site Reliability Engineering
- Why Version Control, And Why Git Won — Advanced Git Internals & Distributed Workflows
- A Repository Is A Folder With A Memory — Advanced Git Internals & Distributed Workflows
- What A Commit Really Is — Advanced Git Internals & Distributed Workflows
- Staging Deliberately: status, add, add --patch — Advanced Git Internals & Distributed Workflows
- Committing, And What A Good Message Says — Advanced Git Internals & Distributed Workflows
- Conventional Commits — Advanced Git Internals & Distributed Workflows
- Reading History: log, show And diff — Advanced Git Internals & Distributed Workflows
- Ignoring Files, And The Tracked File Trap — Advanced Git Internals & Distributed Workflows
- A Branch Is A Moving Pointer — Advanced Git Internals & Distributed Workflows
- HEAD, And Why Detached HEAD Is Not An Error — Advanced Git Internals & Distributed Workflows
- Merging: Fast Forward Or A Merge Commit — Advanced Git Internals & Distributed Workflows
- Rebase: The Same Work, A Different History — Advanced Git Internals & Distributed Workflows
- Undoing: restore, reset, revert And stash — Advanced Git Internals & Distributed Workflows
- What A Remote Actually Is — Advanced Git Internals & Distributed Workflows
- Fetch Is Not Pull — Advanced Git Internals & Distributed Workflows
- Amend, And The One Hard Rule — Advanced Git Internals & Distributed Workflows
- Interactive Rebase: Squash, Reorder, Reword — Advanced Git Internals & Distributed Workflows
- Shipping: scripts, entry points and git — Hands-on Python: Complete Video Course & Book