REFERENCE · GIT BASICS

Git log in one line

Read the history without drowning in it.

One commit per line

--oneline abbreviates the object name and prints the first line of the commit message. Hash lengths and messages depend on your repository; the syntax below is not invented output.

git log --oneline

See branches and joins

--graph draws history edges. --decorate shows reference labels. --all includes commits reachable from all refs rather than only the default revision selection.

git log --graph --oneline --decorate --all

Limit the view

Use -n for a count, and a path after -- to focus on a file. Path-filtered history can simplify what you see, so do not assume it is a complete picture of every merge.

git log -n 10 --oneline
git log --oneline -- notes.txt

Log is not reflog

Log walks commit history. Reflog records local reference movements, such as where HEAD has been. Reflog is local recovery context, not a shared project changelog.

git reflog

Quick check

Which option draws commit relationships?

Choose an answer.

Sources and scope

Command blocks are syntax examples checked against official documentation, not fabricated terminal output. Replace uppercase placeholders with your actual names and inspect status before commands that change work.

git-log · git-reflog ·

All references · Course map

Git, Visually · Reference