目錄 搜尋
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-shortlog  - 总结git log输出

概要

git log --pretty=short | git shortlog [<options>]git shortlog [<options>] [<revision range>] [[\--] <path>…]

描述

以适合纳入发布公告的格式汇总git log输出。每个提交将按作者和标题进行分组。

此外,“提交”将从提交说明中删除。

如果在命令行上没有传递修订,并且标准输入不是终端或没有当前分支,git shortlog则会输出从标准输入中读取的日志的摘要,而不参考当前的存储库。

选项

-n   --numbered

根据每个作者的提交数量而不是作者字母顺序对输出进行排序。

-s   --summary

禁止提交描述并仅提供提交计数摘要。

-e   --email

显示每位作者的电子邮件地址。

--format=<format>

使用一些其他信息来描述每个提交,而不是提交主题。<format>可以是由--format选项接受的任何字符串git log,例如* [%h] %s。(请参阅 git-log [1]的“PRETTY FORMATS”部分。)

Each pretty-printed commit will be rewrapped before it is shown.

-c   --committer

收集并显示提交者身份而不是作者。

-w[<width>[,<indent1>,<indent2>]]

通过包装每行的输入线来包装输出width。每个条目的第一行由indent1空格缩进,第二行和后续行由indent2空格缩进。widthindent1indent2分别默认为76,6和9。

如果宽度为0(零),则缩进输出的行而不包装它们。

<revision range>

仅显示指定修订范围内的提交。当没有指定<revision range>时,它默认为HEAD(即导致当前提交的整个历史记录)。origin..HEAD指定从当前提交(ie HEAD)可访问的所有提交,但不提供origin。有关拼写<修订范围>的完整方法列表,请参阅 gitrevisions [7]的“指定范围”部分。

-- <path>…

只考虑足以解释如何匹配指定路径的文件的提交。

当出现混淆时,路径可能需要以“ - ”作为前缀以将它们与选项或修订范围分开。

映射作者

.mailmap功能用于合并短日志中同一个人的提交,其姓名和/或电子邮件地址拼写有所不同。

如果文件.mailmap存在于版本库的顶层,或者位于 mailmap.file 或 mailmap.blob 配置选项指向的位置,则它用于将作者和提交者名称以及电子邮件地址映射到规范的实名和电子邮件地址。

在简单的形式中,文件中的每一行由作者的标准真实姓名,空格以及在提交中使用的电子邮件地址(用<and 括起来>)映射到名称。例如:

Proper Name <commit@email.xx>

更复杂的形式是:

<proper@email.xx> <commit@email.xx>

它允许 mailmap 只替换提交的电子邮件部分,并且:

Proper Name <proper@email.xx> <commit@email.xx>

它允许 mailmap 替换与指定的提交电子邮件地址匹配的提交的名称和电子邮件,以及:

Proper Name <proper@email.xx> Commit Name <commit@email.xx>

它允许 mailmap 替换与指定的提交名称和电子邮件地址相匹配的提交的名称和电子邮件。

示例1:您的历史记录包含两位作者 Jane 和 Joe 的提交,他们的名字以几种形式出现在存储库中:

Joe Developer <joe@example.com>Joe R. Developer <joe@example.com>Jane Doe <jane@example.com>Jane Doe <jane@laptop.(none)>Jane D. <jane@desktop.(none)>

现在假设乔想让他的中间名得到最初的使用,而珍则更喜欢将她的姓氏完整地拼出来。一个合适的.mailmap文件应该是这样的:

Jane Doe         <jane@desktop.(none)>Joe R. Developer <joe@example.com>

注意如何不需要输入<jane@laptop.(none)>,因为该作者的真实姓名已经是正确的。

示例2:您的存储库包含以下作者的提交:

nick1 <bugs@company.xx>nick2 <bugs@company.xx>nick2 <nick2@company.xx>santa <me@company.xx>claus <me@company.xx>CTO <cto@coompany.xx>

那么你可能需要一个如下所示的.mailmap文件:

<cto@company.xx>                       <cto@coompany.xx>Some Dude <some@dude.xx>         nick1 <bugs@company.xx>Other Author <other@author.xx>   nick2 <bugs@company.xx>Other Author <other@author.xx>         <nick2@company.xx>Santa Claus <santa.claus@northpole.xx> <me@company.xx>

将散列#用于自己的行中或电子邮件地址之后的注释。

上一篇: 下一篇: