I uploaded a smart contract written in Solidity to github but it is not syntax highlighted. Instead it looks like a regular text file. I would like syntax highlighting to be shown on Github. How do I achieve that?
1 Answer
You need to tell github that this file is a Solidity file. Github will not recongnize .sol files automatically at the moment. Add this line to your .gitattributes file:
*.sol linguist-language=Solidity
If you do not have a .gitattributes file you need to create one and place it in the root directory of your git project.
.gitattributes
file is not needed anymore.