Skip to content

Instantly share code, notes, and snippets.

View tomaszprasolek's full-sized avatar
😊

Tomasz Prasołek tomaszprasolek

😊
View GitHub Profile
@tomaszprasolek
tomaszprasolek / filter-branch-prepend-and-append
Created July 11, 2018 10:07 — forked from openjck/filter-branch-prepend-and-append
Using sed and filter-branch to prepend and append to Git commit messages without newlines
# 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