Skip to content

Instantly share code, notes, and snippets.

@zeta709
Created March 20, 2018 14:40
Show Gist options
  • Save zeta709/b7eb552470e1331f164d3e03857db4ba to your computer and use it in GitHub Desktop.
Save zeta709/b7eb552470e1331f164d3e03857db4ba to your computer and use it in GitHub Desktop.
git filter-branch example
#!/bin/bash
git filter-branch --index-filter \
'git rm --cached -qr --ignore-unmatch -- . &&
git reset -q $GIT_COMMIT --
bin/post-slack
zsh/functions/post-slack'
--prune-empty -- --all
git filter-branch -f --tree-filter \
'mv -f zsh/functions/post-slack post-slack ||
mv -f bin/post-slack post-slack || true' \
--prune-empty -- --all
git rebase -i # and do some manual job
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment