Solution:
Create .gitattributes
in git folder and paste linguist-languate=text
after the file path. Example:
/other_libraries/* linguist-language=text
/linguist_ignore.c linguist-language=text
Note: linguist-vendored=false
didn't solve the problem. GitHub still detected marked files as C code.
Problem:
My C++/OpenGL project is compiled using glad.c
, and stb_imbage.h
is included in mail.cpp
file. Both located in root folder which contains .git
directory. These two files have to be present in order to compile the project, so I want to keep them.
Issue: GitHub indexes these files and adds them to Language statistic. It is undesirable since it is not the files containing my code.
How do I keep certain files tracked by Git but exclude them from Languages?
I've tried looking for solution in GitHub docs about Linguist and Stack Overflow but without success.
I know how to ignore files using .gitignore
. But it's not the solution since ignored files just won't be commited.