如何显示 Git 存储库中特定作者更改的文件列表?
如何显示 Git 存储库中特定作者更改的文件?
当我使用此命令 git log --numstat --pretty=tformat:'%an' 时,
git bash 会按作者对文件进行分组,如下所示:
WoJiaoChaDi-YSS
16 6 AHKScriptManager/scripts/AutoInput/HotKeyString.ini
1 1 AHKScriptManager/scripts/RemindMe/RemindConfig.ini
21 0 OneQuick.Ext.ahk
WoJiaoChaDi-PC
1 1 AHKScriptManager/scripts/AutoCapture/config.ini
但我想得到如下结果:(作者在每一行的头部位置)
WoJiaoChaDi-YSS 16 6 AHKScriptManager/scripts/AutoInput/HotKeyString.ini
WoJiaoChaDi-YSS 1 1 AHKScriptManager/scripts/RemindMe/RemindConfig.ini
WoJiaoChaDi-YSS 21 0 OneQuick.Ext.ahk
WoJiaoChaDi-PC 1 1 AHKScriptManager/scripts/AutoCapture/config.ini
那么,谁可以帮助我?
How to show changed files by a specific author in a Git repository?
When I use this command git log --numstat --pretty=tformat:'%an'
,
git bash will group files by the author, like this:
WoJiaoChaDi-YSS
16 6 AHKScriptManager/scripts/AutoInput/HotKeyString.ini
1 1 AHKScriptManager/scripts/RemindMe/RemindConfig.ini
21 0 OneQuick.Ext.ahk
WoJiaoChaDi-PC
1 1 AHKScriptManager/scripts/AutoCapture/config.ini
but I want to get result like this: (author in every line head posistion)
WoJiaoChaDi-YSS 16 6 AHKScriptManager/scripts/AutoInput/HotKeyString.ini
WoJiaoChaDi-YSS 1 1 AHKScriptManager/scripts/RemindMe/RemindConfig.ini
WoJiaoChaDi-YSS 21 0 OneQuick.Ext.ahk
WoJiaoChaDi-PC 1 1 AHKScriptManager/scripts/AutoCapture/config.ini
so, who can help me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
感谢用户14967413兄弟为这个问题提供了方法。
我还有另一种方法,就像这样:
我学了两个小时的awk语法是收获。
Thanks for providing way for this question, user14967413 brother.
And I have an other way to do that, like this:
It is harvest that I have learned awk syntax for 2 hours.
可以通过一些bash脚本来完成:
It could be done with some bash scripting: