показать, какая ревизия и автор последний раз изменяли каждую строку файла (Show what revision and author last modified each line of a file)
Имя (Name)
git-blame - Show what revision and author last modified each line
of a file
Синопсис (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>]
[--progress] [--abbrev=<n>] [<rev> | --contents <file> | --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