虽然我在提交消息中添加了 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/