Closed geoidesic closed 4 months ago
The problem here, sadly, is that you used --paths
rather than --path
. Python has this "helpful" feature where if you don't type the full argument, so long as you type enough leading characters that no other argument could also be spelled with those characters, then it completes it for you. For example, if you had a script that accepted both --dostuff and --runitall, then you wouldn't need to type myscript --dostuff
, you could get away with myscript --do
and it'd complete that to the longer form for you.
In this case, the option you wanted was --path
, but there is also an option named --paths-from-file
. Since --paths
is only a prefix of --paths-from-file
, it picks that option. And that means git-filter-repo treats web/index.html as a file that is supposed to contain a list of filenames you want to keep, one per line (or, since you are using --invert-paths, a list of filenames you want to expunge). Since web/index.html probably have any lines that name any files in your repository, git-filter-repo doesn't find anything to remove.
If you use --path
instead of --paths
, then that'll fix this.
Sorry for taking so long to respond... :-(
Pushed fd5ce386a689 (filter-repo: make --paths
as an option throw an error, 2024-07-02) to prevent others from making the same mistake in the future.
The scenario is someone committed a file they should have. Now it's in .gitignore but git insists on still tracking it (probably because it's already part of the repo). I've tried everything to get git to stop tracking that damn file and I've failed. This was my last resort and it failed too.