-
Run
git logto find the commit hash of the commit you want to sign off. -
Use the git rebase -i command to interactively rebase the commit. Replace COMMIT_HASH with the commit hash you identified:
git rebase -i COMMIT_HASH^This will open an editor with a list of commits, starting from the one you specified.
-
In the editor, change the keyword
picktoeditfor the commit you want to sign off, save the changes, and close the editor. -
Amend the commit to include the "Signed-off-by" line. You can use the --signoff or -s flag with the git commit command:
git commit --amend --signoffThis will open an editor with the commit message. Make sure the "Signed-off-by" line is added at the end of the message, save the changes, and close the editor.
-
Complete the rebase process by running:
git rebase --continue -
If you've made these changes on a local branch that has already been pushed to a remote repository, you'll need to force push the changes:
git push --force-with-lease origin YOUR_BRANCH_NAME
Created
April 5, 2023 02:54
-
-
Save syogaraj/1a7148cb9f818968bf3db756154c3c22 to your computer and use it in GitHub Desktop.
How to signoff a pushed commit
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment