Skip to content

Instantly share code, notes, and snippets.

@tony19
Created April 11, 2016 02:25
Show Gist options
  • Save tony19/63a84fa4a3129a98c66e9fb0b94d5e9c to your computer and use it in GitHub Desktop.
Save tony19/63a84fa4a3129a98c66e9fb0b94d5e9c to your computer and use it in GitHub Desktop.
prefix text to git history
# /usr/bin/env bash -e
# This uses git-filter-branch to prepend a given string to each commit summary.
prefix=:smiley:
ref1=HEAD~2
ref2=HEAD
git filter-branch -f --msg-filter 'stdin=$(cat) && echo "$prefix $stdin"' $ref1..$ref2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment