Setup and Config
Getting and Creating Projects
Basic Snapshotting
Branching and Merging
Sharing and Updating Projects
Inspection and Comparison
Patching
Debugging
External Systems
Server Admin
Guides
- gitattributes
- Command-line interface conventions
- Everyday Git
- Frequently Asked Questions (FAQ)
- Glossary
- Hooks
- gitignore
- gitmodules
- Revisions
- Submodules
- Tutorial
- Workflows
- All guides...
Administration
Plumbing Commands
-
2.56.0
2026-09-28
- 2.54.0 → 2.55.0 no changes
-
2.53.0
2026-02-02
-
2.52.0
2025-11-17
- 2.51.1 → 2.51.2 no changes
-
2.51.0
2025-08-18
- 2.50.1 no changes
-
2.50.0
2025-06-16
- 2.44.1 → 2.49.1 no changes
-
2.44.0
2024-02-23
- 2.43.1 → 2.43.7 no changes
-
2.43.0
2023-11-20
- 2.41.1 → 2.42.4 no changes
-
2.41.0
2023-06-01
- 2.38.1 → 2.40.4 no changes
-
2.38.0
2022-10-02
- 2.34.1 → 2.37.7 no changes
-
2.34.0
2021-11-15
- 2.31.1 → 2.33.8 no changes
- 2.31.0 no changes
- 2.30.1 → 2.30.9 no changes
-
2.30.0
2020-12-27
- 2.29.1 → 2.29.3 no changes
-
2.29.0
2020-10-19
- 2.23.1 → 2.28.1 no changes
-
2.23.0
2019-08-16
- 2.16.6 → 2.22.5 no changes
- 2.15.4 no changes
- 2.13.7 → 2.14.6 no changes
-
2.12.5
2017-09-22
-
2.11.4
2017-09-22
- 2.9.5 → 2.10.5 no changes
-
2.8.6
2017-07-30
-
2.7.6
2017-07-30
- 2.6.7 no changes
-
2.5.6
2017-05-05
-
2.4.12
2017-05-05
-
2.3.10
2015-09-28
- 2.1.4 → 2.2.3 no changes
-
2.0.5
2014-12-17
SYNOPSIS
git blame [-c] [-b] [-l] [--root] [-t] [-f] [-n] [-s] [-e] [-p] [-w] [--incremental] [-L <range>] [-S <revs-file>] [-M] [-C] [-C] [-C] [--since=<date>] [--ignore-rev <rev>] [--ignore-revs-file <file>] [--color-lines] [--color-by-age] [--progress] [--abbrev=<n>] [ --contents <file> ] [<rev> | --reverse <rev>..<rev>] [--] <file>
DESCRIPTION
Annotates each line in the given file with information from the revision which last modified the line. Optionally, start annotating from the given revision.
When specified one or more times, -L restricts annotation to the requested
lines.
The origin of lines is automatically followed across whole-file
renames (currently there is no option to turn the rename-following
off). To follow lines moved from one file to another, or to follow
lines that were copied and pasted from another file, etc., see the
-C and -M options.
The report does not tell you anything about lines which have been deleted or replaced; you need to use a tool such as git diff or the "pickaxe" interface briefly mentioned in the following paragraph.
Apart from supporting file annotation, Git also supports searching the
development history for when a code snippet occurred in a change. This makes it
possible to track when a code snippet was added to a file, moved or copied
between files, and eventually deleted or replaced. It works by searching for
a text string in the diff. A small example of the pickaxe interface
that searches for blame_usage:
$ git log --pretty=oneline -S'blame_usage' 5040f17eba15504bad66b14a645bddd9b015ebb7 blame -S <ancestry-file> ea4c7f9bf69e781dd0cd88d2bccb2bf5cc15c9a7 git-blame: Make the output
OPTIONS
- -b
-
Show blank SHA-1 for boundary commits. This can also be controlled via the
blame.blankBoundaryconfig option. - --root
-
Do not treat root commits as boundaries. This can also be controlled via the
blame.showRootconfig option. - --show-stats
-
Include additional statistics at the end of blame output.
- -L <start>,<end>
- -L :<funcname>
-
Annotate only the line range given by <start>,<end>, or by the function name regex <funcname>. May be specified multiple times. Overlapping ranges are allowed.
<start> and <end> are optional.
-L<start> or-L<start>,spans from <start> to end of file.-L,<end> spans from start of file to <end>.<start> and <end> can take one of these forms:
-
number
If <start> or <end> is a number, it specifies an absolute line number (lines count from 1).
-
/regex/This form will use the first line matching the given POSIX regex. If <start> is a regex, it will search from the end of the previous
-Lrange, if any, otherwise from the start of file. If <start> is^/regex/, it will search from the start of file. If <end> is a regex, it will search starting at the line given by <start>. -
+offset or -offset
This is only valid for <end> and will specify a number of lines before or after the line given by <start>.
If
:<funcname> is given in place of <start> and <end>, it is a regular expression that denotes the range from the first funcname line that matches <funcname>, up to the next funcname line.:<funcname> searches from the end of the previous-Lrange, if any, otherwise from the start of file.^:<funcname> searches from the start of file. The function names are determined in the same way asgitdiffworks out patch hunk headers (see Defining a custom hunk-header in gitattributes[5]). -
- -l
-
Show long rev (Default: off).
- -t
-
Show raw timestamp (Default: off).
- -S <revs-file>
-
Use revisions from revs-file instead of calling git-rev-list[1].
- --reverse <rev>..<rev>