Skip to content

Instantly share code, notes, and snippets.

@nh2
Last active April 13, 2018 18:04
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nh2/66e1cd83a86da7fe43b1 to your computer and use it in GitHub Desktop.
Save nh2/66e1cd83a86da7fe43b1 to your computer and use it in GitHub Desktop.
How to sign off a whole branch in git
[alias]
# Usage: git signoff-rebase [base-commit]
signoff-rebase = "!EDITOR='sed -i -re s/^pick/e/' sh -c 'git rebase -i $1 && while test -f .git/rebase-merge/interactive; do git commit --amend --signoff --no-edit && git rebase --continue; done' -"
# Ideally we would use GIT_SEQUENCE_EDITOR in the above instead of EDITOR but that's not supported for git < 1.7.8.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment