Francis Bacon
Francis Bacon

Reputation: 4755

Find the commit number in git repository through changes string

git log -p | grep "BUSINESS_VERSION=3.13.0.140"
-BUSINESS_VERSION=3.13.0.140
+BUSINESS_VERSION=3.13.0.140

I know I have the changes including the String "BUSINESS_VERSION=3.13.0.140" How do I know in which commit number I made these changes?

Upvotes: 0

Views: 18

Answers (1)

ElpieKay
ElpieKay

Reputation: 30878

git log -G"BUSINESS_VERSION=3.13.0.140"
# or
git log -S"BUSINESS_VERSION=3.13.0.140"

Both should work in your case, but -S and -G behave differently in some cases.

Upvotes: 2

Related Questions