[Git] Combine search patterns with AND in git grep

Created on November 28, 2026

You can combine the -e and --and options of git grep to find lines that match every condition. This example searches for lines that contain both hello and world.

git grep -e "hello" --and -e "world"

References

Git