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 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You’ll notice that the repository that you linked to has a If you add a I hope that helps! |
Beta Was this translation helpful? Give feedback.
-
Thank you, Thank you! =o) |
Beta Was this translation helpful? Give feedback.
You’ll notice that the repository that you linked to has a
.gitattributes
file. 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.gitattributes
file, there is a line to force the file type for.mqh
totext
(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
.gitattributes
file to your repository and instruct git on how to properly interpret the contents of your files, then you sh…