DEV Community

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

Posted on

1 1

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)

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free