How to exclude files & directories from git diff --no-index
问题 How do I exclude files & directories from git diff --no-index ? For example, I want to show the differences between two directories project1 & project2 while ignoring their top-level .git directories ( project1/.git & project2/.git ) and all their .DS_Store files. 回答1: This is not exactly what you asked for, but it might give you the results you want: Add project2 as a remote of project1 and just git diff their HEAD s. git remote add other ../project2/.git git fetch other # Perform the diff