[英]Why does “git log --name-only” show one file change, but “git diff” shows more?
[英]`git log --name-only` show coauthors
雖然我添加了 Co-authored-by: 在提交消息中, git log --name-only
只顯示一個作者,而不是其他作者,但我怎樣才能讓 git 顯示共同作者?
你可以,因為它是一個預告片:
git log --format="%h %s %an Co-author:%(trailers:key=Co-authored-by)"
雖然 Git 確實對此一無所知,但預告片方案允許將您想要的任何key=value
添加到提交消息中。
從Git 2.32 (2021 年第二季度)開始,您可以使用任何您想要的預告片進行提交。
git commit --trailer "Signed-off-by:C O Mitter <committer@example.com>" \
--trailer "Helped-by:C O Mitter <committer@example.com>"
我怎樣才能讓 git 顯示共同作者
你不能。 Git 提交沒有共同作者。 有一個 GitHub 共同作者功能,其他托管環境也可能支持這種東西; 但 Git 本身對此一無所知。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.