我想git给我一个列表,列出一个用户在所有提交中修改的所有文件.
我的特殊用例是我参与了一个ruby on rails项目的i18n,我们想知道哪些文件已经完成以及哪些文件仍然需要完成.有问题的用户只完成了i18n的工作,而不是代码库的其余部分.因此,所有信息都应该是git,但我不知道如何解决这个问题.
h0t*_*1r3 175
这将为您提供一个简单的文件列表,没有别的:
git log --no-merges --author="Pattern" --name-only --pretty=format:"" | sort -u
Run Code Online (Sandbox Code Playgroud)
根据需要切换--committer的作者.
Ste*_*ice 111
这不是唯一的方法,但它有效:
git log --pretty="%H" --author="authorname" |
while read commit_hash
do
git show --oneline --name-only $commit_hash | tail -n+2
done | sort | uniq
Run Code Online (Sandbox Code Playgroud)
或者,作为一行:
git log --pretty="%H" --author="authorname" | while read commit_hash; do git show --oneline --name-only $commit_hash | tail -n+2; done | sort | uniq
Run Code Online (Sandbox Code Playgroud)
试试git log --stat --committer=<user>.只需将用户名放在--committer=选项上(或--author=根据需要使用).
这会吐出每次提交的所有文件,因此可能会有一些重复.
| 归档时间: |
|
| 查看次数: |
28546 次 |
| 最近记录: |