cpa
cpa

Reputation: 3884

Showing which files that match a specific pattern have changed between git branches

I want to merge two branches but before, I'd like to review the changes between the two branches on all files whose filename ends with .twig.

Is it possible, or should I use some bash-magic like git diff --name-only branch1..branch2 | grep .twig ?

Upvotes: 0

Views: 54

Answers (1)

Ciclamino
Ciclamino

Reputation: 591

You can pass the file names to git diff after a --, so:

git diff --name-only branch1..branch2 -- '*.twig'

Should do what you want. I put *.twig in single quotes so the shell won't expand it.

Upvotes: 1

Related Questions