GIT-ANNOTATE(1) | Git Manual | GIT-ANNOTATE(1) |
git-annotate - Annotate file lines with commit information
git annotate [<options>] <file> [<revision>]
Annotates each line in the given file with information from the commit which introduced the line. Optionally annotates from a given revision.
The only difference between this command and git-blame(1) is that they use slightly different output formats, and this command exists only for backward compatibility to support existing scripts, and provide a more familiar command name for people coming from other SCM systems.
-b
--root
--show-stats
-L <start>,<end>, -L :<funcname>
<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:
If <start> or <end> is a number, it specifies an absolute line number (lines count from 1).
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 -L range, 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>.
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 -L range, if any, otherwise from the start of file. “^:<funcname>” searches from the start of file.
-l
-t
-S <revs-file>
--reverse <rev>..<rev>
-p, --porcelain
--line-porcelain
--incremental
--encoding=<encoding>
--contents <file>
--date <format>
--[no-]progress
-M[<num>]
<num> is optional but it is the lower bound on the number of alphanumeric characters that Git must detect as moving/copying within a file for it to associate those lines with the parent commit. The default value is 20.
-C[<num>]
<num> is optional but it is the lower bound on the number of alphanumeric characters that Git must detect as moving/copying between files for it to associate those lines with the parent commit. And the default value is 40. If there are more than one -C options given, the <num> argument of the last -C will take effect.
-h
Part of the git(1) suite
04/20/2020 | Git 2.20.1 |