跳到主要内容

git log 命令过滤提交记录

· 阅读需 1 分钟
git log --grep="feat" --grep="接口" -i --oneline --all-match
  1. 单独使用 --grep="feat" --grep="接口" 表示过滤出 git commit message 包含 feat接口 的提交记录(OR 的逻辑). 如果加上 --all-match 表示要包含 feat接口。(AND 的逻辑
  2. -i 忽略大小写
  3. `--oneline