Skip to content

Instantly share code, notes, and snippets.

@futuregraph
Created December 9, 2016 03:11
Show Gist options
  • Select an option

  • Save futuregraph/b88c584d3d3a0ac5c90f982f3624e281 to your computer and use it in GitHub Desktop.

Select an option

Save futuregraph/b88c584d3d3a0ac5c90f982f3624e281 to your computer and use it in GitHub Desktop.
remove node_modules from git history
git filter-branch --tree-filter 'rm -rf node_modules' --prune-empty HEAD
git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d
git gc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment