-
-
Save JmPotato/cafb091ddf2d8001b229e8d34cbb209d to your computer and use it in GitHub Desktop.
Sign off commit history
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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