diff options
author | EuAndreh <eu@euandre.org> | 2025-04-18 02:17:12 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2025-04-18 02:48:42 -0300 |
commit | 020c1e77489b772f854bb3288b9c8d2818a6bf9d (patch) | |
tree | 142aec725a52162a446ea7d947cb4347c9d573c9 /src/content/en/tils/2020/10 | |
parent | Makefile: Remove security.txt.gz (diff) | |
download | euandre.org-020c1e77489b772f854bb3288b9c8d2818a6bf9d.tar.gz euandre.org-020c1e77489b772f854bb3288b9c8d2818a6bf9d.tar.xz |
git mv src/content/* src/content/en/
Diffstat (limited to 'src/content/en/tils/2020/10')
-rw-r--r-- | src/content/en/tils/2020/10/11/search-git-history.adoc | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/content/en/tils/2020/10/11/search-git-history.adoc b/src/content/en/tils/2020/10/11/search-git-history.adoc new file mode 100644 index 0000000..696368c --- /dev/null +++ b/src/content/en/tils/2020/10/11/search-git-history.adoc @@ -0,0 +1,29 @@ += Search changes to a filename pattern in Git history +:categories: git + +:yet: link:../../08/14/browse-git.html +:another: link:../../08/16/git-search.html +:entry: link:../../08/28/grep-online.html + +This is {yet}[yet] {another}[another] {entry}["search in Git"] TIL entry. You +could say that Git has a unintuitive CLI, or that is it very powerful. + +I wanted to search for an old file that I new that was in the history of the +repository, but was deleted some time ago. So I didn't really remember the +name, only bits of it. + +I immediately went to the list of TILs I had written on searching in Git, but it +wasn't readily obvious how to do it, so here it goes: + +[source,sh] +---- +git log -- *pattern* +---- + +You could add globs before the pattern to match things on any directory, and add +our `-p` friend to promptly see the diffs: + +[source,sh] +---- +git log -p -- **/*pattern* +---- |