3 回答

TA貢獻1825條經驗 獲得超6個贊
git grep <regexp> $(git rev-list --all)
git rev-list --all | xargs git grep <expression>
rev-list
grep
git grep <regexp> $(git rev-list --all -- lib/util) -- lib/util
regexp
.
rev-list
lib/util
grep
lib/util
.
grep
<regexp>
rev-list
git grep <regexp>
git grep -e <regexp1> [--or] -e <regexp2>
git grep -e <regexp1> --and -e <regexp2>
git grep -l --all-match -e <regexp1> -e <regexp2>
git diff --unified=0 | grep <pattern>
git grep <regexp> $(git rev-list --all)
git grep <regexp> $(git rev-list <rev1>..<rev2>)

TA貢獻1772條經驗 獲得超6個贊
Foo
:
git log -SFoo -- path_containing_change git log -SFoo --since=2009.1.1 --until=2010.1.1 -- path_containing_change
這,這個 查找引入或刪除 <string>
.它的意思通常是“用‘foo’添加或刪除行的修訂”。 這個 --pickaxe-regex
選項允許您使用擴展的POSIX正則表達式,而不是搜索字符串。

TA貢獻1998條經驗 獲得超6個贊
git log
-G
-G<regex> Look for differences whose added or removed line matches the given <regex>.
-G
-S
這個 -S
選項實質上計算在提交之前和之后搜索在文件中匹配的次數。如果前后計數不同,則提交將顯示在日志中。例如,這將不會顯示與搜索相匹配的行被移動的位置。 帶著 -G
選項時,如果搜索與添加、刪除或更改的任何行匹配,則提交將顯示在日志中。
diff --git a/test b/test index dddc242..60a8ba6 100644 --- a/test +++ b/test @@ -1 +1 @@ -hello hello +hello goodbye hello
-Shello
hello
-Ghello
.
- 3 回答
- 0 關注
- 1012 瀏覽
添加回答
舉報