Skip to content
Git: Changed File Names With Certain Extension

Git: Changed File Names With Certain Extension

March 17, 2024

For example, how to find changed PHP files between latest and the commit before it: 1

git diff --name-only HEAD~1 HEAD '**/*.php'

If the shell does not support the glob pattern, use grep

git diff --name-only HEAD~1 HEAD | grep .php
Last updated on