我想要git给我一个用户修改的所有文件的列表,所有提交。
我的特殊用例是,我参与了一个ruby on rails项目的i18n,我们想知道哪些文件已经完成,哪些文件还需要完成。有问题的用户只在i18n上做了工作,而没有在代码库的其余部分上做工作。所以所有的信息都应该是git格式的,但是我不知道怎么把它弄出来。
发布于 2011-06-15 04:04:29
这不是唯一的方法,但它是有效的:
git log --pretty="%H" --author="authorname" |
while read commit_hash
do
git show --oneline --name-only $commit_hash | tail -n+2
done | sort | uniq
或者,就像一行:
git log --pretty="%H" --author="authorname" | while read commit_hash; do git show --oneline --name-only $commit_hash | tail -n+2; done | sort | uniq
发布于 2011-06-15 04:08:58
这将为您提供一个简单的文件列表,没有其他内容:
git log --no-merges --author="Pattern" --name-only --pretty=format:"" | sort -u
根据需要切换--author for --提交者。
发布于 2011-06-15 03:54:24
试试git log --stat --committer=<user>
。只需将用户名放在--committer=
选项上(或根据需要使用--author=
)。
这将显示每次提交的所有文件,因此可能会有一些重复。
https://stackoverflow.com/questions/6349139
复制相似问题