Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git magic keywords in commit messages (Signed-off-by, Co-authored-by, Fixes, ...)

Git command itself supports the Signed-off-by: Person's name <persons@email> line.

GitHub adds Co-authored-by: line, which then shows both the committer and the referenced person as commit authors in the UI.

Futhermore, GitHub and GitLab each recognize a set of keywords to close issues when a commit is merged.

Is the list of Git magic keywords above complete? Is there a standardization process for adding these lines and keywords? Are these defined to be case insensitive?

like image 597
user7610 Avatar asked Oct 23 '19 15:10

user7610


People also ask

What is a commit signoff?

Git signoff simply adds a line to your commit message with your full name and email address. It is intended to signal that you created this commit, have permission to submit it, and you adhere to the project licensing.

What is signed off by in git?

Sign-off is a line at the end of the commit message which certifies who is the author of the commit. Its main purpose is to improve tracking of who did what, especially with patches. It should contain the user real name if used for an open-source project.


1 Answers

These are called trailers, and can be pretty much any key-value pair. There is no standardization process and interpretation of trailer lines is platform-dependent (e.g. GitHub, GitLab). See also the documentation for git-interpret-trailers.

Edit: here is some information on some additional trailers used by different tools.

Edit (2): Git itself has some built-in support for a "Signed-off-by: " trailer line as well as a "(cherry picked from commit " trailer line. See git_generated_prefixes in trailer.c as well as the constants in sequencer.c.

like image 173
Chris Yungmann Avatar answered Sep 29 '22 04:09

Chris Yungmann