Eric
Eric

Reputation: 24920

git - Search when a keyword first occur in a file or dir

There is a log/ dir in git repo, and under it resides a file called history.txt.

I want to know when the keyword linux programming first occur in history.txt or log/, means find the date of the first commit contain the keyword.

Is that possible?

Upvotes: 1

Views: 115

Answers (1)

VonC
VonC

Reputation: 1324937

You can use a pickaxe search

git log -S"linux programming" -- log/

Take the oldest commit returned by that command (| tail -1), and you will get your date.

Upvotes: 1

Related Questions