I want to suppress all the output for files in
dir/*
when using the command
git diff
I decided to follow the suggestions from Excluding files from git-diff
Method 1.
Adding to .git/config
[alias]
mydiff = !git diff -- $(git diff --name-only | grep -Ev "dir/")
and using
git mydiff
worked as expected and thus solved my problem. However, I wanted to use Method 2.
Method 2.
Adding to .gitattributes
dir/* -diff
and then using
git diff
Produces the output
diff --git a/dir/1 b/dir/1
deleted file mode 100644
index 05e9130..0000000
...
Question How to suppress this undesired output for all the files in dir/?