4

I have a private repository which has never been published. My current .gitignore excludes many junk files which I previously forgot to exclude, and I would like these junk files to disappear from my git history. https://stackoverflow.com/a/8112372/2024042 explains how to remove a single file bin from the git history, but can I apply the entire rules of .gitignore to all commits in the past, without manually enumerating each individual file?

See also Completely remove file from all Git repository commit history for removing individual files.

Community
  • 1
  • 1
Kevin Yin
  • 844
  • 1
  • 8
  • 26
  • 2
    While `.gitignore` will be deleted whenever Git checkouts an older commit, `.git/info/exclude` (essentially an untracked "`.gitingore`" file) can keep ignoring files while doing any Git operation. The question would remain as how rewrite a commit to untrack every ignored file, so you can use it with `filter-branch`. – André Sassi Oct 19 '16 at 21:47

0 Answers0