Git show filenames only

July 27, 2015

Sometimes, especially when you have multiple developers working on the same codebase it’s nice to get a list of just the filenames that were changed in the last commit or even in your current dirty branch.

Fortunately, Git makes this super easy with the –name-only flag. It goes like this:

Show filenames from the last commit

git show --name-only

Show filenames from the changes yet to be committed

git diff --name-only

Hope that helps!