git diff --name-only

Category: Git - Core

git diff --name-only

List only the names of changed files

Prints just the file paths touched between the two commits, with no diff content. It is the fastest way to get the file list for a commit, a range, or your working tree. Pipe the output to tools like xargs to lint only the changed files.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.