DEV Community

Discussion on: Co-authoring Git commits

Collapse
 
valscion profile image
Vesa Laakso

This is neat! I am myself using the fancy --trailer flag that git commit also provides to do the same:

git commit -m "The commit message" --trailer 'Co-authored-by: name <person@example.com>'
Enter fullscreen mode Exit fullscreen mode

I have even saved this to a git alias when I'm pair-programming more often so that I get the trailer appended automatically. For example:

git config --global alias.commit-jane "commit --trailer 'Co-authored-by: Jane Doe <jane.doe@example.com>'"
Enter fullscreen mode Exit fullscreen mode

Now git commit-jane allows me to commit with Jane in Co-authored-by :)

Collapse
 
oanaom profile image
Oana Munteanu

Ah this is so cool! I'm totally saving this in my gist files. thanks for sharing this!