How to invert `git log --grep=` or How to show git logs that don't match a pattern

前端 未结 8 883
旧巷少年郎
旧巷少年郎 2020-12-02 22:34

I want to use git log to show all commits that do not match a given pattern. I know I can use the following to show all commits that do match a pattern:

8条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-02 23:27

    get a list of all commits containing your result, then filter out their hashes.

    git log --format=oneline | grep -v `git log --grep="bumped to version" --format="%h"`
    

提交回复
热议问题