summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Fankhauser hiddenalpha.ch2024-09-16 17:24:46 +0200
committerAndreas Fankhauser hiddenalpha.ch2024-09-16 17:24:46 +0200
commit527bfde9f3008b7e422c0f5b361f9bebe4e438cc (patch)
treebc447c2aaa6542aa1a72e3cc5600e2a318c4e82f
parentca18b01760938895528a447dfff499c3c0b45391 (diff)
downloadUnspecifiedGarbage-527bfde9f3008b7e422c0f5b361f9bebe4e438cc.zip
UnspecifiedGarbage-527bfde9f3008b7e422c0f5b361f9bebe4e438cc.tar.gz
Add notes how to search git history.
-rw-r--r--doc/note/git/git.txt13
1 files changed, 13 insertions, 0 deletions
diff --git a/doc/note/git/git.txt b/doc/note/git/git.txt
index d0325a1..2dcf2a1 100644
--- a/doc/note/git/git.txt
+++ b/doc/note/git/git.txt
@@ -38,6 +38,19 @@ twice with colon in between):
git log --follow -- path/to/file
+## History search for file contents
+
+Commit message contains: git log --grep foo
+
+ git log -S foo File contents "foo" (literal) num occur has changed:
+ git log --pickaxe-regex foo File contents "foo" (regex) num occur has changed:
+ git log -G foo Diff contains "foo" (regex):
+
+For "-G" add "--patch" to get diff in place of ref.
+
+[src](https://stackoverflow.com/a/1340245/4415884)
+
+
## Auto-destroy code-format
&& REMOTENAME=upstream \