【发布时间】:2023-02-03 21:47:44
【问题描述】:
我知道可以在给定的分支中使用 git ls-tree 到 list all tracked files。
有没有一种有效的方法来列出所有跟踪的文件在所有分支机构?
当然可以编写一个小脚本,例如:
#!/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
然而,当有许多分支时,这似乎相当低效,尤其是如果像往常一样在所有分支中跟踪大多数文件。
有没有更有效的方法来列出所有跟踪的文件?
【问题讨论】:
标签: git