Skip to content

Instantly share code, notes, and snippets.

@MrZenW
Created August 30, 2022 12:18
Show Gist options
  • Save MrZenW/ed48f2be37fa9e903e05df366d0097cc to your computer and use it in GitHub Desktop.
Save MrZenW/ed48f2be37fa9e903e05df366d0097cc to your computer and use it in GitHub Desktop.
If you can't push your repo to GitHub because of a large file in git history and you have even deleted it.
# https://stackoverflow.com/a/23657759
git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch <file/dir>' HEAD
@MrZenW
Copy link
Author

MrZenW commented Jul 26, 2023

According to https://git-scm.com/docs/git-filter-branch#_warning , currently the official advice is to use the alternative tool git filter-repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment