19
votes

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.

1
Make sure you are running git diff from the root of the repository (or alternately, that your path spec is relative to the working folder).yoyo

1 Answers

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

Example

git diff -- */models.py

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