When I want to get a list of the files I have changed so for, I use this command:
git diff --name-only
But many times, I get many files that I don't care about right now. For example, if I am uploading to my PHP server, I usually just want the list of .php files. I tried this:
git diff --name-only **/*.php
But unfortunately, it only shows me files in the first sub-directory. So looks like it is not interpreting the double star as recursive.
Any idea?
just leverage grep:
git diff --name-only | grep .php
git diff --name-only '**/*.php'
(note the quotes)
Edit
Most POSIX shells don't support that pattern. From your comment, I gather that git doesn't either (I cannot test right now).
A workaround could be
git diff --name-only $(find . -name \*.php)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With