Advanced filtering in Git commands
⚡ TL;DR You can use negative filters like git diff ':!*.lock' git status ':!*.lock' and on attributes: git status ':(attr:!linguist-generated !linguist-vendored)' You can even combine those patterns. Excluding on a glob I sometimes have many changes over multiple files in a Git repository. And then I want to display only the changes made to files in the src/ directory: git diff '*/src/*' Or, more interesting, I want all changes except those made to lock files: ...