[英]Filter git log to show only my changes
如何过滤git log
以仅显示我的更改(不包括其他开发人员提交的更改)?
You can filter the log by the author for example, so you can filter by your name : 例如,您可以按作者过滤日志,以便按名称过滤:
git log --author="YourName"
or by committer : 或者通过提交者:
git log --committer="YourName"
You should use the --author
flag to the git-log
command . 您应该在
git-log
命令中使用--author
标志 。
Like so: 像这样:
git log --author="You Name"
Part of name is also working: 部分名称也有效:
git log --author=Name
However if you want to use in a generic script like in this tip , you could do it like this: 但是,如果你想在这个技巧中使用通用脚本,你可以这样做:
git log --author="$(git config user.name)"
You could then make an alias: 然后你可以创建一个别名:
git config --global alias.mylog '!git log --author="$(git config user.name)"'
You could then just type: git mylog
and see your commits only. 然后你可以输入:
git mylog
并查看你的提交。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.