TankorSmash
TankorSmash

Reputation: 12747

How to enable wildcard file paths for git diff?

I would expect git diff to work like git add and others, in being able to do something like

git diff **/models.py

rather than having to do

git diff /full/path/to/my/python/file/called/models.py

It's strange though because

git commit **/models.py
git add **/models.py

both work as you'd expect.

Upvotes: 24

Views: 8016

Answers (1)

Zombo
Zombo

Reputation: 1

git diff [options] [<commit>] [--] [<path>...]

Example

git diff -- */models.py

http://kernel.org/pub/software/scm/git/docs/git-diff.html

Upvotes: 31

Related Questions