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