This is three parts this is a more step-by-step question than Make Git rebuild history using the current .gitignore
I was wondering if it is possible to do a rebase to some early point in history and set the
.gitignore
rules there such that it carries it all the way to the top. The way I do it isgit checkout KNOWN_COMMIT_WITH_PROPER_GITIGNORE .gitignore && git rebase --continue
Apply the removal of ignored files for each commit in the history while
--preserve-merges
https://stackoverflow.com/a/19757964/242042. I am thinking this can be done in a similar way ofgit-filter-branch
Create an alias that would do this operation
Key thing is that this needs to be based on the .gitignore
that could've changed over time and I want a specific version of the .gitignore
file applied to the first commit and applied through the rest of history.