Follow

In case you ever need to rename a variable across multiple (e.g. 10) git commits:

git rebase -i HEAD~10 --exec 'git diff --name-only --diff-filter=AMC HEAD~ | xargs sed -i "s/BEFORE/AFTER/g"; git commit -a --amend --no-edit'

To edit commit messages:
git filter-branch -f --msg-filter 'sed -e "s/BEFORE/AFTER/g"' HEAD~10..HEAD

Based on: stackoverflow.com/a/39608848/3

I needed this for (and dozens of commits on top later): github.com/bitcoin/bitcoin/pul

Sign in to participate in the conversation
Mastodon

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!