Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save gdesatrigraha/d07a416a67fcd0fc8f1c to your computer and use it in GitHub Desktop.
Save gdesatrigraha/d07a416a67fcd0fc8f1c to your computer and use it in GitHub Desktop.
remove a directory / files from all git commits
git filter-branch --prune-empty -d /dev/shm/scratch \
--index-filter "git rm --cached -f -r --ignore-unmatch sreader/cms/static" \
--tag-name-filter cat -- --all
git update-ref -d refs/original/refs/heads/master
git reflog expire --expire=now --all
git gc --prune=now
git push -f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment