目录 搜索
Guides gitattributes giteveryday gitglossary gitignore gitmodules gitrevisions gittutorial gitworkflows Administration git archive git bundle git clean git filter-branch git fsck git gc git instaweb git reflog Basic Snapshotting git add git commit git diff git mv git reset git rm git status Branching and Merging git branch git checkout git log git merge git mergetool git stash git tag Debugging git bisect git blame git grep Email git am git format-patch git request-pull git send-email External Systems git fast-import git svn Getting and Creating Projects git clone git init Git git annotate git archimport git bisect-lk2009 git check-attr git check-mailmap git check-ref-format git checkout-index git cherry git citool git column git credential git credential-cache git credential-store git cvsexportcommit git cvsimport git cvsserver git diff-files git diff-tree git difftool git fast-export git fetch-pack git fmt-merge-msg git get-tar-commit-id git gui git http-backend git http-fetch git http-push git imap-send git index-pack git interpret-trailers git ls-remote git ls-tree git mailinfo git mailsplit git merge-file git merge-index git merge-one-file git merge-tree git mktag git mktree git name-rev git notes git p4 git pack-objects git pack-redundant git pack-refs git parse-remote git patch-id git prune git prune-packed git quiltimport git receive-pack git remote-ext git remote-fd git remote-testgit git repack git replace git rerere git send-pack git sh-i18n git sh-setup git shell git show-branch git show-index git stripspace git unpack-file git unpack-objects git upload-archive git upload-pack git var git verify-commit git verify-tag git whatchanged git worktree Inspection and Comparison git describe git shortlog git show Miscellaneous api credentials api index gitcli gitcore tutorial gitcredentials gitcvs migration gitdiffcore githooks gitk gitnamespaces gitremote helpers gitrepository layout gitsubmodules gittutorial 2 gitweb gitweb.conf pack format User Manual Patching git apply git cherry-pick git rebase git revert Plumbing Commands git cat-file git check-ignore git commit-tree git count-objects git diff-index git for-each-ref git hash-object git ls-files git merge-base git read-tree git rev-list git rev-parse git show-ref git symbolic-ref git update-index git update-ref git verify-pack git write-tree Server Admin git daemon git update-server-info Setup and Config git git config git help Sharing and Updating Projects git fetch git pull git push git remote git submodule
文字

名称

git-annotate  - 用提交信息注释文件行

概要

git annotate [options] file [revision]

描述

使用引入该行的提交的信息来标注给定文件中的每一行。可以从给定的修订中注释。

这个命令与 git-blame [1] 唯一的区别在于它们使用稍微不同的输出格式,并且此命令仅用于向后兼容以支持现有脚本,并为来自其他 SCM 系统的人员提供更熟悉的命令名称。

选项

-b

显示边界提交的空白 SHA-1。这也可以通过blame.blankboundary配置选项来控制。

--root

不要将根提交视为边界。这也可以通过blame.showRoot配置选项来控制。

--show-stats

在过失输出结尾包含更多统计数据。

-L <start>,<end>   -L :<funcname>

仅注释给定的线范围。可以多次指定。重叠范围是允许的。

<start>(<开始>)和<end> (<结束>)是可选的。“-L <start>(-L <开始>)”或“-L <start>(-L <开始>)”跨越从 <start> (<开始>)到文件结束。“-L,<end>(-L ,<结束>)”从文件开始到<end>(<结束>)。

<start>(<开始>)和<end>(<结束>)可以采取以下形式之一:

  • 数字                                                          如果<start> (<开始>)或<end>(<结束>)是一个数字,它指定一个绝对行号(行数从1开始)。

  • /regex/

这个表单将使用与给定的 POSIX 正则表达式匹配的第一行。如果 <start> 是一个正则表达式,它将从前一个-L范围的末尾(如果有的话)开始搜索,否则从文件起始处开始搜索。如果 <start> 是“^ / regex /”,它将从文件开头搜索。如果 <end> 是一个正则表达式,它将从 <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>.

如果给出“:<funcname>”来代替<start>和<end>,它是一个正则表达式,表示从匹配<funcname>的第一个 funcname 行到下一个funcname行的范围。“:<funcname>”从上一个-L范围的末尾(如果有)搜索,否则从文件开头搜索。“^:<funcname>”从文件开头搜索。

-l

显示长时间(默认:关闭)。

-t

显示原始时间印章(默认值:关闭)。

-S <revs-file>

使用 revs-file 中的修订版而不是调用 git-rev-list [1]。

--reverse <rev>..<rev>

前进而不是后退。它不是显示一行出现的修订,而是显示一行存在的最后修订。这需要一系列的修订,如 START..END,在 START 中存在责任路径。git blame --reverse STARTgit blame --reverse START..HEAD为了方便而用以代替的。

-p   --porcelain

以设计用于机器消耗的格式显示。

--line-porcelain

显示易碎的格式,但输出每行的提交信息,而不仅仅是第一次引用提交。意味着 - 易碎品。

--incremental

以设计用于机器消耗的格式逐步显示结果。

--encoding=<encoding>

指定用于输出作者姓名和提交摘要的编码。将其设置为none使责备输出未转换的数据。有关更多信息,请参阅有关 git-log [1]手册页中编码的讨论。

--contents <file>

当未指定<rev>时,该命令注释从工作树副本向后开始的更改。该标志使命令假装工作树副本具有指定文件的内容(指定-使命令从标准输入中读取)。

--date <format>

指定用于输出日期的格式。如果未提供--date,则使用 blame.date 配置变量的值。如果 blame.date 配置变量也未设置,则使用 iso 格式。有关支持的值,请参阅 git-log [1]上的--date 选项的讨论。

--no-progress

当连接到终端时,默认情况下标准错误流会报告进度状态。即使没有附加到终端,该标志也可以进行进度报告。不能将--progress--porcelain或者--incremental 一起使用。

-M<num>

检测文件中移动或复制的行。当提交移动或复制一行代码块时(例如,原始文件有A然后B,提交将其更改为B然后A),传统blame算法只会注意到一半的移动,并且通常会将移动的线(即B)交给双亲,并将责任分配给向下移动(即A)到孩子提交的行。有了这个选项,通过运行额外的检查通道,这两组线都被归咎于双亲。

<num>是可选的,但它是 Git 必须检测的字母数字字符数的下限,以便在文件中移动/复制,以便将这些行与父提交相关联。默认值是20。

-C<num>

除了-M检测从同一提交中修改的其他文件移动或复制的行之外。当您重新组织您的程序并在各个文件之间移动代码时,这非常有用。当该选项被赋予两次时,该命令会另外在创建该文件的提交中查找来自其他文件的副本。当该选项被赋予三次时,该命令还会在任何提交中查找来自其他文件的副本。

<num>是可选的,但它是 Git 必须检测的字母数字字符数的下限,作为文件之间的移动/复制,以便将这些行与父提交相关联。默认值是40。如果有多个-C选项,最后的<num>参数-C将生效。

-h

显示帮助信息。

--indent-heuristic   --no-indent-heuristic

这些是为了帮助调试和调整实验启发式(默认情况下是关闭的),这些启发式技术改变了差异边界以使修补程序更易于阅读。

上一篇: 下一篇: