For me, just git add *.c did not work. I encountered a fatal error:
git add *.php The following paths are ignored by one of your .gitignore files: wp-config.php Use -f if you really want to add them. fatal: no files added
So, in this option, git tried to add ignored files.
But this option:
git add \*.php
worked flawlessly. By the way, you can do git diff in the same way:
git diff -- \*.php
source share