Skip to content

Instantly share code, notes, and snippets.

@plembo
Created July 22, 2019 13:05
Show Gist options
  • Save plembo/67c200c9abe46105db24e3e462a4deee to your computer and use it in GitHub Desktop.
Save plembo/67c200c9abe46105db24e3e462a4deee to your computer and use it in GitHub Desktop.
Use git filter-branch to remove file

Use git filter-branch to remove file from repo

File already pushed to github. In this case it's too big and should have been compressed first. This is how to remove it completely. If others have their own copies of repo, will need to coordinate with them.

Issue command from root of local copy of repo:

$ git filter-branch --tree-filter 'rm -f resources/products.json' -- --all

Force push change to github remote repo (set as origin):

$ git push origin --force --all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment