From e857611f9ff4bc8c8bd5b5bd3d24d2dec4e90ca0 Mon Sep 17 00:00:00 2001 From: Waldir Pimenta Date: Thu, 29 Jan 2026 20:22:31 +0000 Subject: [PATCH] git-blame: edit page (#20768) Co-authored-by: Ivan Baluta Co-authored-by: Dylan <145150333+dmmqz@users.noreply.github.com> --- pages/common/git-blame.md | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/pages/common/git-blame.md b/pages/common/git-blame.md index d4ba46e503..4ff354d0b7 100644 --- a/pages/common/git-blame.md +++ b/pages/common/git-blame.md @@ -1,32 +1,36 @@ # git blame -> Show commit hash and last author on each line of a file. +> Show what commit and author last modified each line of a file. > More information: . -- Print file with author name and commit hash on each line: +- Print a file with authorship info (author name and commit hash): `git blame {{path/to/file}}` -- Print file with author email and commit hash on each line: +- Print the author's email instead of their name: `git blame {{[-e|--show-email]}} {{path/to/file}}` -- Print file with author name and commit hash on each line at a specific commit: +- Print a file with authorship info as of a specific commit: `git blame {{commit}} {{path/to/file}}` -- Print file with author name and commit hash on each line before a specific commit: +- Print a file with authorship info before a specific commit: `git blame {{commit}}~ {{path/to/file}}` -- Jump to the parent of a specific commit and track a specific text and 10 of its following lines: +- Print a file with authorship info starting at a given line: -`git blame -L '/{{text}}/',+10 {{a82812aa}}^ {{path/to/file}}` +`git blame -L {{123}} {{path/to/file}}` -- Print author name and commit hash information for a specific line range: +- Annotate a specific line range of a file: `git blame -L {{start_line}},{{end_line}} {{path/to/file}}` -- Ignore whitespaces and line moves: +- Annotate 10 lines of a file starting at the first line matching a given text: + +`git blame -L '/{{text}}/',+10 {{path/to/file}}` + +- Annotate a file ignoring whitespaces and line moves: `git blame -w -C -C -C {{path/to/file}}`