devroom.io/content/posts/2011-06-24-git-what-files-were-changed-since-the-last-release.md
2019-06-05 14:32:16 +02:00

17 lines
907 B
Markdown

+++
date = "2011-06-24"
title = "Git: What files were changed since the last release?"
tags = ["git", "log", "history"]
slug = "git-what-files-were-changed-since-the-last-release"
+++
Sometimes it handy to get a list out of `git log` that tells you which files were changed since your last release. It's not straight forward, but very doable with the help of `git log` and `grep`.
~
Let's say you want to view all the changed files since the last tagged release, `v1.3.1`:
``` shell
git log --reverse --name-status HEAD...v1.3.1 | grep -e ^[MAD][[:space:]]
```
As you're used to, this shows each files that *A*dded, *M*odified or *D*eleted. This command does not squash file changes. So it's possible for a file to first be added, the deleted, then added again and later modified. The `--reverse` option shows file changes historically, so the first file changed after the v1.3.1 release is shown first.