[英]How do I see which files have ever been edited by a user in a git repo?
Not sure if there is a way to use git blame across all files to check file history for all files in the repo and see if your user has edited it before.不确定是否有办法在所有文件中使用 git blame 来检查存储库中所有文件的文件历史记录,并查看您的用户之前是否编辑过它。 Looking to run a report for fun to see how much of the codebase I have explored and some areas I should spend more time looking into!
希望以有趣的方式运行报告,看看我探索了多少代码库以及我应该花更多时间研究的一些领域!
Running git blame across the whole repo sounds slow and may not capture the full file history.在整个存储库中运行 git blame 听起来很慢,并且可能无法捕获完整的文件历史记录。 Perhaps looking at the repo commit history and the file diff for all the commits you edited would be a better approach.
也许查看回购提交历史记录和您编辑的所有提交的文件差异会是更好的方法。
You can try something like:你可以尝试这样的事情:
git log --oneline --author="<me>" --name-only
this will list files that show up as modified in commits you authored.这将列出在您编写的提交中显示为已修改的文件。
You may try --name-status
or --numstats
instead of --name-only
,您可以尝试
--name-status
或--numstats
而不是--name-only
,
you may also add -w
(short for --ignore-all-space
) to overlook lines where you only changed the indentation.您还可以添加
-w
( --ignore-all-space
缩写)以忽略仅更改缩进的行。
If you want to restrict the log to files that only exist in the current commit (and avoid seeing files or directories that have been moved or delete since their creation), you may use git ls-files
to have a list of files to filter:如果您想将日志限制为仅存在于当前提交中的文件(并避免看到自创建以来已移动或删除的文件或目录),您可以使用
git ls-files
来获取要过滤的文件列表:
git log ... -- $(git ls-files)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.