git - `git log --name-only` 显示合作者

标签 git git-log

虽然我在提交消息中添加了 Co-authored-by:,git log --name-only 只显示一位作者,而不显示其他作者,但如何让 git 显示共同作者?

最佳答案

你可以,因为它是一个 trailer :

git log --format="%h %s %an Co-author:%(trailers:key=Co-authored-by)"

虽然 Git 确实对此一无所知,但尾部方案允许将您想要的任何 key=value 添加到提交消息中。

Git 2.32 (2021 年第 2 季度),您可以提交任何您想要的预告片。

git commit --trailer "Signed-off-by:C O Mitter <committer@example.com>" \
           --trailer "Helped-by:C O Mitter <committer@example.com>"

关于git - `git log --name-only` 显示合作者,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72653563/

相关文章:

Git checkout 分支从其他分支离开目录树

git - 如何在 `git log` 中的每个提交中显示分支名称

git - `git log --follow --graph` 跳过提交

Git push 命令,遇到错误 -fatal : invalid refspec 'https://github.......git'

visual-studio - TFS、SVN 和 GIT 有什么区别?

git - 有没有办法让 git 自动为 --version 选项生成版本号文件?

git log origin/develop 给出 "fatal: ambiguous argument"

Rstudio 找不到开发工具

git - git log -p:显示差异还是生成补丁?

git - 为什么 "git log -‌- foo"对删除的文件 foo 不起作用?