Answers:
例如,您可以按作者过滤日志,因此可以按名称过滤:
git log --author="YourName"
或通过提交者:
git log --committer="YourName"
-i
启用了不区分大小写的正则表达式,其值为--author
您应该--author
在git-log
命令中使用标志。
像这样:
git log --author="You Name"
名称的一部分也起作用:
git log --author=Name
但是,如果您想在本技巧之类的通用脚本中使用,可以这样做:
git log --author="$(git config user.name)"
然后,您可以做一个别名:
git config --global alias.mylog '!git log --author="$(git config user.name)"'
然后,您可以键入:git mylog
并且仅查看您的提交。
my-history = !git log --author=\"$(git config user.name)\"