Git command to show files changed in a commit

How to see exactly which files have changed in a single commit

Recently I wanted to pull a list of changed files from an older commit from the command line.

Turns out (like most things in Git) this is very easy to do.

git show --name-only {commit}

You can replace {commit} with the SHA1 you want to retrieve, or things like HEAD or HEAD^^

I made this post into a YouTube video


Recent posts View all

Ruby

Forcing a Rails database column to be not null

How you can force a table column to always have something in it with Rails

Writing Marketing

We've deleted an article's worth of unhelpful words

We've improved several pages across our site by removing words that add no value, and often detract from the article.