Skip to content

Git: History & search

7 Git commands: History & search. Click a command to see what each part does.

Index
7 items
Click a command to see what each part does.
  • git log --oneline --graph --decorate --allCompact graph of all branches

    What each part does

    1. git logshow commit history
    2. --onelineone line per commit: short hash + subject
    3. --graphASCII graph of branches and merges
    4. --decorateshow branch and tag names next to commits
    5. --allinclude every branch and tag, not just the current one
  • git log --oneline | grep -i <text>Find commits whose message mentions something

    What each part does

    1. git log --onelineone commit per line
    2. | grep -i <text>keep lines containing <text>, any case

    Tip Built-in: git log --oneline --grep=<text> -i

  • git log --oneline --author=<name> --since=<date> --until=<date>Commits by someone in a date range

    What each part does

    1. --author=<name>author matches (regex)
    2. --since / --untildate range, e.g. "2 weeks ago", 2026-11-01
  • git log -S"<text>" -pWhen was this string added or removed?

    What each part does

    1. -S"<text>""pickaxe": commits that changed how many times <text> appears
    2. -pshow the diff of each matching commit
  • git log --follow -p -- <file>History of one file, across renames

    What each part does

    1. --followkeep following the file when it was renamed
    2. -pwith diffs
    3. -- <file>"--" ends options; what follows is a path
  • git blame -L <start>,<end> -- <file>Who changed these lines

    What each part does

    1. blamelast commit + author for every line
    2. -L <start>,<end>only that line range
  • git status -sb; git diff; git diff --stagedWhat is staged vs not

    What each part does

    1. status -sbshort status with branch info
    2. git diffunstaged changes
    3. git diff --stagedwhat will go into the next commit

My DevOps Playbook by Angelo John Calleja

New runbook

GitHub not connected

Saving is handled by the site: the GitHub token is stored in Cloudflare, not in your browser. Enter the editor password (the EDITOR_PASSWORD secret) to unlock saving in this browser.

Saving commits to gelogrammer/My_DevOps_Playbook. Create a fine-grained token with access to only this repo andContents: Read and write, then paste it here. It is stored only in this browser.

src/content/docs/…