Search code examples
gitgitignoregit-stash

git stash show -p: hide gitignored files


When I use stash, I run git stash -u so that all files are stashed.

When I want to look at the stash contents using git stash show -p, it will also include in the diff files which are in my .gitignore list. This is understandable, since -p stands for "patch", but is there a way to ask git to not show these gitignored files in the stash show -p output?


Solution

  • Ok, it seems git diff stash@{0}^..stash@{0} is what I want. Or change to any other stash ID of course.