File cannot be viewed, only downloaded (classed a raw) #22076
|
Similar to the thread “GitHub doesn’t show my code [view raw]”, my code files cannot be viewed directly and can only be downloaded (they are classed as ‘view raw’) For instance, here’s one of my files The file extension is an MQL4 .mqh (very similar to C) Is there some sort of Repository (or individual file) configuration necessary to get these files recognised? I’ve searched the community, googled but can’t find anything - except this thread I’ve mentioned above. Thanks |
Replies: 3 comments
|
You’ll notice that the repository that you linked to has a If you add a I hope that helps! |
|
Thank you, Thank you! =o) |
|
can u say how does a raw file gets fixed |
You’ll notice that the repository that you linked to has a
.gitattributesfile. This file is used to inform git that its defaults might not recognize a file type properly and to override them. I notice that in that.gitattributesfile, there is a line to force the file type for.mqhtotext(as opposed to binary), as well as force the character set to CP1252 for all files in the directory you linked to. (git doesn’t do well when you’re using a character set other than UTF-8, which might be why those files are being recognized as binary instead of text.)If you add a
.gitattributesfile to your repository and instruct git on how to properly interpret the contents of your files, then you sh…