Skip to content

Instantly share code, notes, and snippets.

@crash7
Created August 22, 2015 01:40
Show Gist options
  • Save crash7/3cd6e3e497b16db4587b to your computer and use it in GitHub Desktop.
Save crash7/3cd6e3e497b16db4587b to your computer and use it in GitHub Desktop.
Rewrite git message for specifics commits
git filter-branch -f --msg-filter '
read commit
declare -A commits_replaces;
commits_replaces["<commit hash>"]="new message"
if [[ ${commits_replaces[$GIT_COMMIT]} ]]; then
echo ${commits_replaces[$GIT_COMMIT]};
else
echo $commit
fi' -- --all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment