Exclude file from “git diff”

Omg, drivers and awk to exclude a lousy file? Since Git 1.9 something you can:

git diff -- . ':(exclude)db/irrelevant.php' ':(exclude)db/irrelevant2.php'

(On Windows, replace the single quotes ' by double quotes ".)

Ah, elegance! See the quoted answer and for details this answer by @torek.

Leave a Comment