Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add the Signed-off-by field in the git patch

Tags:

git

I'm generating a git patch. And then I want to send it to the project maintainer.

I want to mark my Name and my email address as signed-off-by in the git patch

How to do it ? in order that the project maintainer get the signed-off-by field with my name and email address.

like image 335
MOHAMED Avatar asked Nov 19 '12 15:11

MOHAMED


People also ask

How do I format a patch in git?

In order to create Git patch file for a specific commit, use the “git format-patch” command with the “-1” option and the commit SHA. In order to get the commit SHA, you have to use the “git log” command and look for the corresponding commit SHA.

What is signed off 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.

What is git patch command?

GIT patch or GIT diff is used to share the changes made by you to others without pushing it to main branch of the repository. This way other people can check your changes from the GIT patch file you made and suggest the necessary corrections.

How can I see my git patch?

Git Cola includes an "Apply Patches" dialog that can be launched from the Actions menu, or via the git cola am sub-command. You can open patches in this dialog and display the contents with diff syntax highlighting. This feature is available in master by cloning the repo and will be in the upcoming v3.


1 Answers

When you commit, just use:

git commit -s 

or

git commit --signoff 

Or you can just write at the end of the commit message, on a line by itself separated by a blank line from the body of the commit:

Signed-off-by: Your Name <[email protected]> 

If you already have the commit, use git commit -s --amend to add the above signoff line.

Or, if you are going to be sending this as a patch or patch series, you can use git format-patch -s or --signoff to add the signoff to the patch itself, without modifying the commit.

like image 128
Brian Campbell Avatar answered Oct 14 '22 07:10

Brian Campbell