雖然我在提交訊息中添加了 Co-authored-by:,但git log --name-only只顯示一個作者,而不顯示其他作者,我怎樣才能讓 git 顯示共同作者?
uj5u.com熱心網友回復:
我怎樣才能讓 git 顯示共同作者
你不能。Git 提交沒有共同作者。有一個 GitHub 共同作者功能,其他托管環境也可能支持這種東西;但 Git 本身對此一無所知。
uj5u.com熱心網友回復:
你可以,因為它是一個預告片:
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 <[email protected]>" \
--trailer "Helped-by:C O Mitter <[email protected]>"
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/492210.html
上一篇:字串是否為數字的檢測方法分享
