Riho
Riho

Reputation: 4593

Git diff for specific folder

I'm listing the files that have changed between 2 different tags

git diff --name-only v2.1.1 v2.1.2

It results to something like:

test/file1
test/file2
www/file3
www/file4

Is there any way how I could limit this to list only files that are in www/ folder

Upvotes: 3

Views: 6894

Answers (1)

Schwern
Schwern

Reputation: 164699

From the git-diff docs...

   git diff [--options] <commit> <commit> [--] [<path>...]
       This is to view the changes between two arbitrary <commit>.

The -- tells git unambiguously what is a commit and what is a path. So in your case that would be.

git diff --name-only v2.1.1 v2.1.2 -- www/

Upvotes: 9

Related Questions