git add only c files

C++
git add "*.c"
git add "*.h"
git add "*.cpp"

Source

Also in C++: