git/list[1] front-page[2] threads[3] people[4] search[5] about
 

How can I search git log with ceratin keyword but without the other keyword?

From
孙S孙世龙 sunshilong <sunshilong369@gmail.com>
Date
Jul 10, 2020, 04:31 UTC
Message-ID
<CAAvDm6Z2HcQkyinCD4hKTnqGR3gcXodhoo0YKSnbB-vDJcn3MQ@mail.gmail.com>
Hi, list
How can I search git log with ceratin keyword_a but without keyword_b?

Assume I have a branch master with 3 commits, the comments are t123, b1 and b12 separately, that is: b90b03f (HEAD -> master) b12 27f7577 b1 7268b40 t123

And now, I want to use git log --grep to search the log with the keyword "12" but without t123. The result I want is b90b03f b12

How can I achieve this?
Thank you for your attention to this matter.
Next: Carlo Arenas
Message 1 of 16 in “How can I search git log with ceratin keyword but without the other keyword?”
  1. 孙世龙 sunshilongJul 10, 2020
  2. Carlo ArenasJul 10, 2020
  3. 孙世龙 sunshilongJul 11, 2020
  4. Jeff KingJul 16, 2020
  5. 孙世龙 sunshilongJul 17, 2020
  6. Jeff KingJul 17, 2020
  7. Junio C HamanoJul 17, 2020
  8. Junio C HamanoJul 17, 2020
  9. 孙世龙 sunshilongJul 18, 2020
  10. Junio C HamanoJul 18, 2020
  11. 孙世龙 sunshilongJul 19, 2020
  12. Carlo ArenasJul 19, 2020
  13. Junio C HamanoJul 20, 2020
  14. Carlo ArenasJul 22, 2020
  15. 孙世龙 sunshilongJul 17, 2020
  16. 孙世龙 sunshilongJul 17, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.