Skip to content

Instantly share code, notes, and snippets.

@kwk
Created October 1, 2014 13:52
Show Gist options
  • Select an option

  • Save kwk/d70f20d17b18c4f3296d to your computer and use it in GitHub Desktop.

Select an option

Save kwk/d70f20d17b18c4f3296d to your computer and use it in GitHub Desktop.
Forgot to sign-off commits?
@ghsatpute

Copy link
Copy Markdown

How to apply to specific commit
When I run
git filter-branch --msg-filter "cat - && echo && echo 'Signed-off-by: Ganesh Satpute <name@gmail.com>'" HEAD~2..HEAD~1
I get
Which ref do you want to rewrite?

@jan25

jan25 commented Jun 16, 2019

Copy link
Copy Markdown

For signing off a specific commit you could do git commit --amend -s -c <SHA>

@jan25

jan25 commented Jun 16, 2019

Copy link
Copy Markdown

@onajib

onajib commented Jan 23, 2020

Copy link
Copy Markdown

the command of jan25 works but with an uppercase S : git commit --amend -S -c <SHA>

@Florian-Schoenherr

Copy link
Copy Markdown

if you also want the commit with the SHA itself: git commit --amend -S -c <SHA>^

@hiteshagja

hiteshagja commented Feb 15, 2022

Copy link
Copy Markdown

git commit --amend --no-edit -S [SHA]
git push --force-with-lease [origin branch_name]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment