DEV Community

Cover image for List all files changed in last commit
Adam K Dean
Adam K Dean

Posted on

List all files changed in last commit

List all files changed in the last commit by using git diff-tree on HEAD.

git diff-tree --no-commit-id --name-only -r HEAD
Enter fullscreen mode Exit fullscreen mode

For example, if you changed README.md in your last commit:

adam@macbook:project (master) $ git diff-tree --no-commit-id --name-only -r HEAD
README.md
Enter fullscreen mode Exit fullscreen mode

Top comments (0)