Forked from openjck/filter-branch-prepend-and-append
Created
November 3, 2017 06:38
-
-
Save agsdot/8c019e32bfe095f586b6b0438140ce44 to your computer and use it in GitHub Desktop.
Using sed and filter-branch to prepend and append to Git commit messages without newlines
This file contains hidden or 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
# Prepending text to the five most recent commit messages: | |
git filter-branch --msg-filter 'sed "s/\(.*\)/[prepended text] \1/g"' HEAD~5..HEAD | |
# Appending text to the five most recent commit messages: | |
git filter-branch --msg-filter 'sed "s/\(.*\)/\1 [appended text]/g"' HEAD~5..HEAD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment