I will use git filter-repo
to extract a folder and its history from a repository.
Its documentation says,
Note that much like git itself, renames are NOT followed so you may need to specify multiple paths, e.g.
--path olddir/ --path newdir/
That's saying that I should to specify explicitly the previous names of files outside the folder, so that their history is retained too.
Is there a convenient way to get the old names of all files in a folder?
The help for git log --follow
says, "(works only for a single file)" -- so an algorithm might be:
git log --follow
I suppose I can do that -- i.e. write a script to issue git log --follow
commands for each file, and parse the output -- is this the best or only way?
Running git filter-repo --analyze
produces various files including renames.txt
.
It's not filtered per-path, it's for the whole repository.
You can parse it to find/filter whatever folders interest you.