Commit be24814e authored by Jamie Tanna's avatar Jamie Tanna

Document how to list files changed in a commit

Closes #831.
parent e08f5404
Pipeline #103233942 passed with stages
in 9 minutes and 16 seconds
title: "List What Files Changed in a Git Commit"
description: "How to list what files changed in a given commit."
- blogumentation
- git
- command-line
license_code: Apache-2.0
license_prose: CC-BY-NC-SA-4.0
date: 2019-12-15T22:28:28+0000
slug: "git-files-changed"
image: /img/vendor/git.png
I've found in the past that it can be useful to know what files have changed in a given commit, i.e. to re-edit them, or to [add whitespace to the end of file]({{< ref "2019-09-02-newlines-all-git-files" >}}).
We can do this with the `diff-tree` subcommand, giving it a commit to look at, and it'll return a list of all files changed:
$ git diff-tree --no-commit-id --name-only -r HEAD
$ git diff-tree --no-commit-id --name-only -r e08f540464a6adbddda7de71b85fc793ddfac2a8
Taken from [_How to list all the files in a commit?_ on Stack Overflow](
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment