I want to get files changed between branches, but I want to filter out root level files, meaning files that aren't in any directory.
These files can be identified by that they don't have / in their path.
I know for example that if I want to exclude some dir I can do
git diff .... -- :!dir_name
However, I'm not sure how to add an exclusion to files without /.
This works for me on Bash on Linux:
git diff ':/*/**'
These * are supposed to be interpreted by Git, not by the
shell. That’s why I’m using single quotes.
If you do not insist in how to exclude files, you can use
git diff HEAD~7 -- '*/*'
i.e., you include everything that has at least one / in the name.
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