How to search through all Git and Mercurial commits in the repository for a certain string?

I have a Git repository with few branches and dangling commits. I would like to search all such commits in repository for a specific string.

I know how to get a log of all commits in history, but these don’t include branches or dangling blobs, just HEAD’s history. I want to get them all, to find a specific commit that got misplaced.

I would also like to know how to do this in Mercurial, as I’m considering the switch.

10 Answers
10

Leave a Comment