2

What if I forget to sign-off my last commit, how can I fix the last commit within Magit?

I can do that with git command:

$ git commit --signoff --amend

Of cause I can write the sign-off by hand in the rebase reword buffer, but does Magit provide easy way to do?

3

Changing the last commit message

What you are wanting to do is change (rewrite) the last commit message to add the signed-off line.

Go to the git status window (a common key binding is C-x g)

type c to get into commit

type -s to enable the signed-off line

type w to reword the last commit message, check that you have the wanted signed-off field.

type C-cC-c to do the commit

To enable -s as the default

You can set the -s option as the default by

type c to go to commit

If needed, type C-t to enable the common options

type -s to toggle the signed-off, toggle other options as desired.

type C-cC-c to set the defaults.

  • I somehow didn't realize that amending is commit command. It's exactly what I type in the command line. git commit --signoff --amend. It's just that magit is better than git, and using reword, which translates to --amend --only. – Yasushi Shoji Mar 8 '18 at 11:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.