Skip to content
LatchkeyLatchkey home

git whatchanged: Usage, Options & Common CI Errors

git whatchanged lists each commit together with the files it changed.

whatchanged is an older, log-like command showing per-commit file changes. It still works, but git log --raw / --name-only is the documented, preferred way today.

What it does

git whatchanged walks history like git log but defaults to showing, for each commit, the list of files it modified (in raw diff format), making per-commit file churn easy to scan.

Common usage

Terminal
git whatchanged --oneline
git whatchanged -p -- path/to/file
git whatchanged --since="1 week ago"
# modern equivalent:
git log --raw --oneline

Options

FlagWhat it does
--onelineCompact commit headers
-pShow the full patch too
-- <path>Limit to changes under a path
--since / --untilFilter by date

Common errors in CI

whatchanged is deprecated in favor of git log, so prefer git log --name-only / --raw for new scripts to avoid relying on legacy defaults. On a shallow clone it shows only the fetched commits, which can make file-history reports look truncated.

Using this in CI

CI checkouts are shallow and detached by default, which changes the answer this command gives you. Commands that read history, branch names, or tags need the checkout configured for it.

.github/workflows/ci.yml
- uses: actions/checkout@v4
  with:
    fetch-depth: 0   # history, tags, and git describe all need this

- run: |
    git rev-parse --is-shallow-repository   # expect false
    git rev-parse --abbrev-ref HEAD          # prints HEAD when detached

Frequently asked questions

git whatchanged: Usage, Options & Common CI Errors?
whatchanged is an older, log-like command showing per-commit file changes. It still works, but git log --raw / --name-only is the documented, preferred way today.
What it does?
git whatchanged walks history like git log but defaults to showing, for each commit, the list of files it modified (in raw diff format), making per-commit file churn easy to scan.
Common errors in CI?
whatchanged is deprecated in favor of git log, so prefer git log --name-only / --raw for new scripts to avoid relying on legacy defaults. On a shallow clone it shows only the fetched commits, which can make file-history reports look truncated.

Related guides

References

Run this faster and cheaper on Latchkey managed runners - self-healing included. Start free → 30-day trial · No credit card