Git 仅按文件名记录以检测该文件名是否曾经存在于回购协议中

Git log by only the filename to detect if the filename ever existed in the repo

我想查看具有特定名称的文件存在或曾经存在于 git 存储库中,仅通过文件名查询(在我不知道完整文件路径的情况下)。

我可以使用 git log --follow -- <full filepath> 查看具有完整文件路径的文件的提交历史,即使它来自给定文件路径 removed/moved。 但是我不能只提供文件名。 例如,

git log --follow -- xbmc/input/AppTranslator.cpp

显示结果但是,

git log --follow -- AppTranslator.cpp

没有显示任何内容。

如何检测某个文件名是否曾经存在于 git 存储库中并获取其完整文件路径和提交历史记录?

评论中的答案是正确的。

git log --follow -- '*AppTranslator.cpp'