Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git diff for specific folder

Tags:

git

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

like image 466
Riho Avatar asked Dec 07 '25 01:12

Riho


1 Answers

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/
like image 158
Schwern Avatar answered Dec 08 '25 15:12

Schwern



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!