I own a Github repository which has a collection of scripts/programs in different languages to perform a task. The problem is that by default, my repository is marked to be in single language. I googled and tried to fix it with the .gitattributes file.
* linguist-vendored
*.py linguist-vendored=false
This piece of code helped me to mark Python as the default language, but I still want my repo to be marked with more languages. Is there a way around to achieve this? Or there can only be one language marked with a repository? Thanks.
GitHub's language-detection has its own rather lengthy README.md file that you will also see below the contents of the repository itself. As it notes, it can detect multiple different languages and display them:
but:
and by writing:
you have directed it to ignore all files. Your subsequent directive of:
overrides this directive specifically for
*.pyfiles, allowing them to be classified.The odd thing is that you bothered to add a
.gitattributesat all. You need only do this if you must hide files or override the automated detection. What you did was hide all non-*.pyfiles, so you are applying automated detection (not an explicit language override) for files that do match the*.pypattern.You should also make particular note of their remarks that:
(emphasis mine)