Adding a DCO Signed-off-by to every commit in a git repo
By Adrian Sutton
If you’re switching from a CLA model to a DCO model you may want to add a Signed-off-by line to every existing commit so that you can run automated DCO checks over the entire repository. Doing this obviously assumes that your CLA sets things up so that you are actually in a position to provide a DCO sign-off.
Once you’re happy with all the legalities, the change is a single command using git filter-branch:
git filter-branch --msg-filter "cat - && echo && echo 'Signed-off-by: Some Person <some.person@example.com>'"