I know one can use git ls-tree
to list all tracked files in a given branch.
Is there an efficient way to list all tracked files in all branches?
One can of course write a small script like:
#!/bin/bash
(
for b in $(git branch --no-color|tr '*' ' '|tr -s " "|cut -d " " -f 2)
do
git ls-tree -r "${b}" --name-only
done
)| sort | uniq
This seems however rather inefficient when there are many branches, and especially if, as usual, most files are tracked in all branches.
Is there a more efficient way to list all tracked files?