I have several "interesting" files (which I have touched) among all other files in the Git history. And I want to publish the "interesting" files only with their history as a Git repo, without any other files being present anywhere in the history of this repo.
How to write a smart script for git filter-branch --index-filter
? (Or at least for git filter-branch --tree-filter
, which is however undesirable, since it is slower, and my saved trees are huge.)
Note that my question is a bit different to the most common similar one people are asking 12: How to remove a specific ("sensitive") file from the Git history? I need to remove the complement, and keep the specific files.