Skip to content

Instantly share code, notes, and snippets.

@disksing
Last active Sep 2, 2020
Embed
What would you like to do?
Sign off commit history
#!/bin/bash
# Add missing DCOs for current branch (starting from merge base to master)
# Following commit history as an example, this script will affect commits E,F,G.
#
# v master
# A - B - C - D - H - I
# \
# E - F - G
# ^ feature (HEAD)
#
# Please make sure the commits were submitted originated from you, or you have
# permission to submit the code.
git filter-branch -f --msg-filter \
'git interpret-trailers --if-missing add \
--trailer "Signed-off-by: $(git config user.name) <$(git config user.email)>"' \
master..HEAD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment