Although I have added Co-authored-by: in the commit message, git log --name-only only shows one author, not the others, how can I make git show the coauthors?
Although I have added Co-authored-by: in the commit message, git log --name-only only shows one author, not the others, how can I make git show the coauthors?
You can, in that it is a trailer:
git log --format="%h %s %an Co-author:%(trailers:key=Co-authored-by)"
While it is true Git knows nothing about it, the trailer scheme allows to add any key=value you want to the commit message.
Since Git 2.32 (Q2 2021), you can make a commit with any trailer you want.
git commit --trailer "Signed-off-by:C O Mitter <committer@example.com>" \
--trailer "Helped-by:C O Mitter <committer@example.com>"
how can I make git show the coauthors
You can't. Git commits don't have coauthors. There is a GitHub coauthor feature, and other hosting milieus may support that sort of thing too; but Git itself knows nothing of it.