-
git rebase:
git rebase -i <old-commit>
- Change
pick
intodrop
- Delete the commit line
- Change
-
git filter-branch
# Delete the greped commit
git filter-branch --commit-filter '
if echo "$GIT_COMMIT" | grep -q -e "message1" -e "message2"
then
skip_commit "$@"
else
git commit-tree "$@"
fi
' HEAD
# Push to the remote
git rebase --continue
git push origin --force --all -v