git usually relies on the path extension provided by the shell, and this is true since path extension is not exactly the task of a version control system. Therefore, you should look at your choice wrapper to see if it supports something like path extension ... If you use bash, you can set the globstar option
shopt -s globstar
and then you can use a double asterisk to get the extension you need:
git diff foo*.py
Please note that based on my tests, a double asterisk does not match partial path components. In other words, it should be followed and preceded by a slash for this pattern to match something like foo/bar/blah/baz.py If you try to write foo/ba**/*.py , it will match the same as foo/ba*/*.py .
source share