diff options
author | EuAndreh <eu@euandre.org> | 2025-03-31 21:51:40 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2025-03-31 21:51:40 -0300 |
commit | 570ec471d1605318aeefb030cd78682ae442235b (patch) | |
tree | 51e17eabe37c6689f8799b55e6875c3480329a2c /src/content/tils/2020/10/11/search-git-history.adoc | |
parent | Makefile, mkdeps.sh: Derive index.html and feed.xml from more static "sortdat... (diff) | |
download | euandre.org-570ec471d1605318aeefb030cd78682ae442235b.tar.gz euandre.org-570ec471d1605318aeefb030cd78682ae442235b.tar.xz |
src/content/: Update all files left to asciidoc
Diffstat (limited to 'src/content/tils/2020/10/11/search-git-history.adoc')
-rw-r--r-- | src/content/tils/2020/10/11/search-git-history.adoc | 47 |
1 files changed, 17 insertions, 30 deletions
diff --git a/src/content/tils/2020/10/11/search-git-history.adoc b/src/content/tils/2020/10/11/search-git-history.adoc index 251abe9..b6af8f9 100644 --- a/src/content/tils/2020/10/11/search-git-history.adoc +++ b/src/content/tils/2020/10/11/search-git-history.adoc @@ -1,41 +1,28 @@ ---- += Search changes to a filename pattern in Git history -title: Search changes to a filename pattern in Git history +:yet: link:../../08/14/browse-git.html +:another: link:../../08/16/git-search.html +:entry: link:../../08/28/grep-online.html -date: 2020-10-11 +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. -layout: post +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. -lang: en +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: -ref: search-changes-to-a-filename-pattern-in-git-history - -eu_categories: git - ---- - -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 +[source,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 +[source,shell] +---- git log -p -- **/*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 %} +---- |