I tried using git grep -i 'search' README.md and the output found some lines I was interested in looking at, but these lines did not print out the git sha's so that I could get more information about these commits. The output looked like this:
README.md:ElastiCache, ElasticSearch, and RDS setup with Terraform
How do I see the git sha for this line? I looked at the documentation and it didn't even contain the word "commit" or "sha" in it.
Without additional specifications,
git grepjust looks at the current commit.To look in other commit(s) (or the index), you must name them (or use
--cached). For instance, compare:vs:
If you list multiple trees (or commit IDs) to search, the results have your specifiers prefixed, so that you know which one they go with.