Is it possible to filter the files in diff for their extensions? #25991
-
Is it possible to filter the files in diff for their extensions? I have test1.json, test1.txt in a folder , I want to filter only test1.json using diff, I saw some answer in internet git diff – ‘*.json’ , but that didn’t work for me. |
Beta Was this translation helpful? Give feedback.
Answered by
airtower-luna
Jun 30, 2020
Replies: 1 comment
-
You can pass a list of files for
The file list can be created by a shell glob, that’s what
does. However,
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can pass a list of files for
git diff
to compare against the current HEAD like this:The file list can be created by a shell glob, that’s what
does. However,
*.json
matches only files in the current directory. If your files are in subdirectories you have two options:find
to build the file list, e.g.globstar
shell option and use**
to match any number of directories: