I am writing a program in C which uses header files. These header files contain some structure declarations and, as C structures and C++ are pretty much the same, GitHub recognizes these files as C++ file, while I want them to be recognized as C files.
Is there a way to force GitHub recognizing header files as C files instead of C++ files?
Github uses the linguist library to detect your code language. According to the readme in their git you need to create a .gitattributes if you don't have one and write in it the files/types you're matching to a language
So basically put in your .gitattributes
*.h linguist-language=C
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With