Git: Finding changes in ALL commits

Finding changes

When you're looking for a specific change in Git, there are multiple axes you can choose:

Note that you can do most of these things with Git tools as well, e.g. tig path/to/file.

Considering ALL commits

By default, only the current branch (HEAD) is searched. To search across the entire local repository, add these options:

  • --all: Search all known refs (branches, tags, remotes)
  • --first-parent: Simplification for merges
  • --reflog: Search all reflog entries

Example: git log --all --first-parent --reflog -- path-to-file.

Hat tip to BigMiner Show archive.org snapshot .

Considering certain branches

You can use --branches to (only) search all branches. Pass a pattern to filter, e.g. --branches=dominikschoeler or --branches='*1274*'.

Dominik Schöler