1 day ago · Tech · hide · 0 comments

Today I learned that you can hide languages that show up on the side on GitHub repositories and other hosted Git services like GitLab. You can do this by adding a .gitattributes file to your repository. For example, I have a bunch of fake PHP files to mess with bots and script kiddies, such as: https://nelson.cloud/wp-login.php. As a result, GitHub was showing that most of my language usage for this repository was “Hack”: Hack is not representative of what I actually use to build this static site. I wanted to get rid of “Hack” from the languages bar. To do that, I created a .gitattributes file at the root of my repository, then I added this line to exclude PHP files from being counted: *.php -linguist-detectableThis will exclude all PHP files in this repository from being counted in the languages bar. Committing and pushing this .gitattributes file to my repository results in “Hack” being gone (along with 0.1% of PHP): You can also only exclude files in certain directories. For…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.