我可以让git告诉我一个用户修改过的所有文件吗? [英] Can I get git to tell me all the files one user has modified?

查看:183
本文介绍了我可以让git告诉我一个用户修改过的所有文件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我的特殊使用案例是我一直在用git来给我一个由一个用户修改的所有文件的列表。参与了Ruby on Rails项目的国际化,我们想知道哪些文件已经完成,哪些文件还需要完成。有问题的用户只完成了国际化的工作,而不是其他代码库。所以这些信息都应该在git中,但我不知道如何解决。 这不是唯一的办法,但它的工作原理:

  git log --pretty =%H--author =authorname 
while read read_hash
do
git show --oneline --name-only $ commit_hash |尾巴-n + 2
完成|排序| uniq

或者,作为一行:

  git log --pretty =%H--author =authorname|同时读取commit_hash;做git show --oneline --name-only $ commit_hash |尾巴-n + 2;完成|排序| uniq 


I would like git to give me a list of all the files modified by one user, across all commits.

My particular use case is that I've been involved in the i18n of a ruby on rails project, and we want to know what files have already been done and what files still need to be done. The users in question have only done work on the i18n, not on the rest of the code base. So the information should all be in git, but I'm not sure how to get it out.

解决方案

This isn't the only way, but it works:

git log --pretty="%H" --author="authorname" |
    while read commit_hash
    do
        git show --oneline --name-only $commit_hash | tail -n+2
    done | sort | uniq

Or, as one line:

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告诉我一个用户修改过的所有文件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆