git diff is one of the frequently used git commands during software development. It shows you the changes you made locally from the last commit. However, sometimes you don’t want to see the diff from specific directories. For example in the minified JS/CSS files. The folders can be excluded from the git diff by using the following command:

git diff -- ':!<folder-name>'

Exclude directory when using git diff
Tagged on:

Sanjeev Aryal

Don't bury your thoughts, put your vision into reality ~ Bob Marley.

Leave a Reply

Your email address will not be published. Required fields are marked *

Pin It on Pinterest