Created
August 4, 2023 07:59
-
-
Save Treborium/fda10b406b36ec8fe8143146b4863614 to your computer and use it in GitHub Desktop.
Show modified files in git repository
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git diff --name-only --diff-filter=ACMRT | grep -E '.*\.schema\.json$' |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This command will output a list of files that have been added, copied, modified, renamed, or had their type changed in the repository, and then filter that list to only include files that end with
.schema.json.Here's a breakdown of the command:
git diff: Shows changes between commits, commit and working tree, etc.--name-only: Shows only the names of changed files.--diff-filter=ACMRT: Filters the output to only include files that have been added, copied, modified, renamed, or had their type changed.|: Pipes the output of thegit diffcommand to the next command.grep -E: Searches for files that match the regular expression.'.*\.schema\.json$': The regular expression that matches files ending with.schema.json.Possible extensions:
The
--exit-codeflag will return1if there changes to files and0otherwise, which is particularly useful for scripting.