Does any one how to exclude files when comparing folders with git diff --no-index ? It seems this option
':(exclude)*.min.css'
does not work with no-index (outside working tree)
In fact, it runs it twice, or more precisely, it runs two different internal variations on git diff : one to compare HEAD to the index/staging-area, and one to compare the staging-area to the work-tree. It runs each diff with a request to search for renames, i.e., sets the -M flag (see below).
^M represents carriage return. This diff means something removed a Unicode BOM from the beginning of the line and added a CR at the end.
You can run the git diff HEAD command to compare the both staged and unstaged changes with your last commit. You can also run the git diff <branch_name1> <branch_name2> command to compare the changes from the first branch with changes from the second branch.
The pathspec :(exclude) and its short form :! or :^ is available only within a Git working tree.
So:
git diff --no-index
in a find -exec
command with exclude directives.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