简体   繁体   中英

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. 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. 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 ,
you may also add -w (short for --ignore-all-space ) to overlook lines where you only changed the indentation.

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 log ...  -- $(git ls-files)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM