Skip to content
Tutorials Center
My learning

Topics

Git Reference ยท Inspecting History

git whatchanged command

Reference for git whatchanged: a historical command that shows commits with raw diff output. Learn why it is deprecated and which git log options replace it.

git whatchanged shows commit logs together with the raw diff of each commit: one line per changed file with modes, object IDs and a status letter. It is the ancestor of today's git log, kept for old scripts and habits.

Git treats it as a deprecated command. Since Git 2.51 it refuses to run unless you pass --i-still-use-this, and the manual recommends git log --raw --no-merges instead, which produces the same kind of output. Use git log in anything new.

Terminal
git whatchanged --i-still-use-this [<log-options>] [<revision-range>] [-- <path>...]
git log --raw --no-merges [<revision-range>] [-- <path>...]

Try it

Bash The modern equivalent

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with read or cat), it gets the next line from this box.

Bash Restrict to a path and to names only

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with read or cat), it gets the next line from this box.

Syntax

The raw format printed per file is a colon, the old mode, the new mode, the old object ID, the new object ID, a status letter, a tab and the path. For example :100644 100644 <old> <new> M<TAB>a.txt. Status letters: A added, M modified, D deleted, R renamed, C copied, T type changed.

Option Description
--i-still-use-this Required by recent Git versions to acknowledge that the command is deprecated.
-p Add the patch, like git log -p.
--no-merges The old default: whatchanged omitted merge commits. git log --raw shows them unless you add this.
--name-only, --name-status Shorter listings (these are git log options).
-n <number>, <range>, -- <path> Limit commits like git log.

Usage notes

  • Differences from git log --raw: whatchanged hid merge commits and always printed raw diffs; git log includes merge commits (which print no diff by default) and prints no raw output unless you ask for it.
  • The command takes all git log options because it is implemented as git log with defaults changed.
  • Old scripts that call git whatchanged should be changed to git log --raw --no-merges so they keep working when the command is removed.
  • The raw format is also what plumbing commands such as git diff-tree and git diff-index print, so it is stable and easy to parse. Add -z to separate fields with NUL bytes for file names with spaces.