2

I have a GitHub repository that is C-only. After my latest commit, in which I modified preprocessor spacing in a header file, GitHub decided my repository was 50.2% C++. I clicked on the link to look at the C++ code and it showed my header file portable.h.

Why does GitHub think my repo is 50% C++? And more importantly, how can I change its mind?

MD XF
  • 7,860
  • 7
  • 40
  • 71

2 Answers2

5

I figured out how to fix it. I added a linguist override line to my .gitattributes file:

*.h linguist-language=C

I'm still not sure why GitHub decided the file was C++. If an answer is posted which solves that question, I'll accept it.

MD XF
  • 7,860
  • 7
  • 40
  • 71
-4

It might be related to the fact that C++ is a superset of C, it means any C project is also a C++ project.

Gustavo Topete
  • 1,246
  • 1
  • 9
  • 15
  • 1
    My other repos: [all C](https://github.com/aaronryank/c-prohackr112), [all C](https://github.com/aaronryank/finer-points-of-c), [all C](https://github.com/aaronryank/rk-lang), [all C](https://github.com/aaronryank/minproj), [all C](https://github.com/aaronryank/arkdoc). Nope. – MD XF Mar 10 '17 at 17:41