Using sed to edit commit header

Just in case I forget about this in the near future:

1
git filter-branch -f --msg-filter 'sed "1s/^/THING/g"' HEAD^..HEAD

^ This adds THING to your commit header within the range HEAD^ to HEAD

Same thing can be done to the bottom line, but it’s not useful for me.


Using sed to edit commit header
https://dev.pppig236.com/blog/post/Using-sed-to-edit-commit-header.html
Author
Weikai Kong
Posted on
January 16, 2022
Updated on
August 16, 2023
Licensed under