Friday, May 7, 2021

How to force syntax highlighting in github source code file

 By default github performs syntax highlighting without extra work. But occasional, some code files appear in plaintext without any syntax highlighting.

How to fix?

Create a file .gitattributes in the same directory, and specify the highlighting requirements inside. Below is one for SQL language.

*.sql linguist-language=sql


No comments:

Post a Comment