1GIT-ANNOTATE(1)                   Git Manual                   GIT-ANNOTATE(1)
2
3
4

NAME

6       git-annotate - Annotate file lines with commit information
7

SYNOPSIS

9       git annotate [options] file [revision]
10
11

DESCRIPTION

13       Annotates each line in the given file with information from the commit
14       which introduced the line. Optionally annotates from a given revision.
15
16       The only difference between this command and git-blame(1) is that they
17       use slightly different output formats, and this command exists only for
18       backward compatibility to support existing scripts, and provide a more
19       familiar command name for people coming from other SCM systems.
20

OPTIONS

22       -b
23           Show blank SHA-1 for boundary commits. This can also be controlled
24           via the blame.blankboundary config option.
25
26       --root
27           Do not treat root commits as boundaries. This can also be
28           controlled via the blame.showroot config option.
29
30       --show-stats
31           Include additional statistics at the end of blame output.
32
33       -L <start>,<end>
34           Annotate only the given line range. <start> and <end> can take one
35           of these forms:
36
37           ·   number
38
39               If <start> or <end> is a number, it specifies an absolute line
40               number (lines count from 1).
41
42           ·   /regex/
43
44               This form will use the first line matching the given POSIX
45               regex. If <end> is a regex, it will search starting at the line
46               given by <start>.
47
48           ·   +offset or -offset
49
50               This is only valid for <end> and will specify a number of lines
51               before or after the line given by <start>.
52
53       -l
54           Show long rev (Default: off).
55
56       -t
57           Show raw timestamp (Default: off).
58
59       -S <revs-file>
60           Use revisions from revs-file instead of calling git-rev-list(1).
61
62       --reverse
63           Walk history forward instead of backward. Instead of showing the
64           revision in which a line appeared, this shows the last revision in
65           which a line has existed. This requires a range of revision like
66           START..END where the path to blame exists in START.
67
68       -p, --porcelain
69           Show in a format designed for machine consumption.
70
71       --line-porcelain
72           Show the porcelain format, but output commit information for each
73           line, not just the first time a commit is referenced. Implies
74           --porcelain.
75
76       --incremental
77           Show the result incrementally in a format designed for machine
78           consumption.
79
80       --encoding=<encoding>
81           Specifies the encoding used to output author names and commit
82           summaries. Setting it to none makes blame output unconverted data.
83           For more information see the discussion about encoding in the git-
84           log(1) manual page.
85
86       --contents <file>
87           When <rev> is not specified, the command annotates the changes
88           starting backwards from the working tree copy. This flag makes the
89           command pretend as if the working tree copy has the contents of the
90           named file (specify - to make the command read from the standard
91           input).
92
93       --date <format>
94           The value is one of the following alternatives:
95           {relative,local,default,iso,rfc,short}. If --date is not provided,
96           the value of the blame.date config variable is used. If the
97           blame.date config variable is also not set, the iso format is used.
98           For more information, See the discussion of the --date option at
99           git-log(1).
100
101       -M|<num>|
102           Detect moved or copied lines within a file. When a commit moves or
103           copies a block of lines (e.g. the original file has A and then B,
104           and the commit changes it to B and then A), the traditional blame
105           algorithm notices only half of the movement and typically blames
106           the lines that were moved up (i.e. B) to the parent and assigns
107           blame to the lines that were moved down (i.e. A) to the child
108           commit. With this option, both groups of lines are blamed on the
109           parent by running extra passes of inspection.
110
111           <num> is optional but it is the lower bound on the number of
112           alphanumeric characters that Git must detect as moving/copying
113           within a file for it to associate those lines with the parent
114           commit. The default value is 20.
115
116       -C|<num>|
117           In addition to -M, detect lines moved or copied from other files
118           that were modified in the same commit. This is useful when you
119           reorganize your program and move code around across files. When
120           this option is given twice, the command additionally looks for
121           copies from other files in the commit that creates the file. When
122           this option is given three times, the command additionally looks
123           for copies from other files in any commit.
124
125           <num> is optional but it is the lower bound on the number of
126           alphanumeric characters that Git must detect as moving/copying
127           between files for it to associate those lines with the parent
128           commit. And the default value is 40. If there are more than one -C
129           options given, the <num> argument of the last -C will take effect.
130
131       -h
132           Show help message.
133

SEE ALSO

135       git-blame(1)
136

GIT

138       Part of the git(1) suite
139
140
141
142Git 1.8.3.1                       11/19/2018                   GIT-ANNOTATE(1)
Impressum