【问题标题】:Git - List files created by authorGit - 列出作者创建的文件
【发布时间】:2014-07-30 02:14:25
【问题描述】:

有没有办法列出特定作者使用 Git 创建的文件? 我还需要通过文件名(正则表达式/模式)或创建它们的文件夹来过滤这些结果。

所以我要查找的是作者创建(未更新)的文件列表,没有文件名重复和提交消息。

【问题讨论】:

标签: git logging


【解决方案1】:

列出所有提交添加文件,显示提交作者和添加文件;然后将作者粘贴到列出的每个文件的前面:

# add `--author=pattern` to the log arguments to restrict by author
# add anything you like to the `--format=` template
# add any restrictions you like to the `/^A\t/` selector in the awk,
#     ... say /^A\t/ && /\.c$/ { etc.

git log --name-status --diff-filter=A --format='> %aN' \
| awk '/^>/ {tagline=$0}
       /^A\t/ {print tagline "\t" $0}'

【讨论】:

  • 完美:git log --author="Vadorequest" --name-status --diff-filter=A --format='> %aN' | awk '/^>/ {tagline=$0} /^A\t/ {print tagline "\t" $0}'。谢谢!
【解决方案2】:

试试这个

$ git whatchanged --author="yourAthor" --name-only

这里还有一些过滤器

http://gitref.org/inspect/

【讨论】:

  • 更接近,但我不想通过提交看到它,既不是提交消息也不是没有文件名重复。不过谢谢。
【解决方案3】:
git whatchanged --author="AuthorName" --name-only --oneline | grep FilePath | sort | uniq -c

【讨论】:

    猜你喜欢
    • 2014-09-08
    • 1970-01-01
    • 2012-05-05
    • 1970-01-01
    • 2011-05-13
    • 2014-04-03
    • 2015-12-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多