Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nowhereman/210084 to your computer and use it in GitHub Desktop.
Save nowhereman/210084 to your computer and use it in GitHub Desktop.
Git - Rewriting a specific commit message in history
#!/bin/bash
#Rewriting a specific commit message in Git history
#If you have this message 'Namespace refs/original/ not empty'
#Remove the sub folders of your $GIT_REPO_ROOT/.git/refs/original
#Replace <commit-id> by your commit id !
git filter-branch --msg-filter '
test $GIT_COMMIT = <commit-id> && echo "My new commit message" || cat
' HEAD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment