diff options
author | EuAndreh <eu@euandre.org> | 2020-10-11 11:30:30 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2020-10-11 12:50:21 -0300 |
commit | 88e529d2fed16d9f2465ccb370444b59242e927a (patch) | |
tree | 6ca42538abf74c73340149000d73e6ed678bf5db | |
parent | rollout slides: Add tweaked version, after improving post presentation (diff) | |
download | euandre.org-88e529d2fed16d9f2465ccb370444b59242e927a.tar.gz euandre.org-88e529d2fed16d9f2465ccb370444b59242e927a.tar.xz |
Add TIL entry on searching the Git log for a filename pattern
-rw-r--r-- | _tils/2020-10-11-search-changes-to-a-filename-pattern-in-git-history.md | 33 | ||||
-rw-r--r-- | scripts/spelling/en.txt | 1 | ||||
-rw-r--r-- | scripts/spelling/international.txt | 1 |
3 files changed, 35 insertions, 0 deletions
diff --git a/_tils/2020-10-11-search-changes-to-a-filename-pattern-in-git-history.md b/_tils/2020-10-11-search-changes-to-a-filename-pattern-in-git-history.md new file mode 100644 index 0000000..07f5405 --- /dev/null +++ b/_tils/2020-10-11-search-changes-to-a-filename-pattern-in-git-history.md @@ -0,0 +1,33 @@ +--- +title: Search changes to a filename pattern in Git history +date: 2020-10-11 +layout: post +lang: en +ref: search-changes-to-a-filename-pattern-in-git-history.md +--- + +This is [yet][git-til-1] [another][git-til-2] ["search in Git"][git-til-3] 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: + +```shell +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: + +```shell +git log - -- **/*pattern* +``` + +[git-til-1]: {% link _tils/2020-08-14-browse-a-git-repository-at-a-specific-commit.md %} +[git-til-2]: {% link _tils/2020-08-16-search-in-git.md %} +[git-til-3]: {% link _tils/2020-08-28-grep-online-repositories.md %} diff --git a/scripts/spelling/en.txt b/scripts/spelling/en.txt index 8a4f0d0..3899718 100644 --- a/scripts/spelling/en.txt +++ b/scripts/spelling/en.txt @@ -37,6 +37,7 @@ symlinks syncable só tradeoffs +unintuitive untrusted ve wasn diff --git a/scripts/spelling/international.txt b/scripts/spelling/international.txt index b56072c..a757baa 100644 --- a/scripts/spelling/international.txt +++ b/scripts/spelling/international.txt @@ -78,6 +78,7 @@ Staltz Sten TAB TBs +TILs TOML TypeScript UI |