Source files shown as binary files

I am new to github forum. I have seen that in pull request “Files Changed” view, some of my source files(.h/.cpp) are shown as binary so that the changes are not seen in place. I am not sure if this question has been asked before. How can I change it ? I guess this was caused by some encoding change though I have not explicitly changed the encoding . I am using Tortise git UI to access git.

If git is detecting the type of your files incorrectly, you can explicitly tell it which file extensions are text by using a .gitattributes file in the root of your repository. You could add the following lines to it to ensure that the file types you mention are recognized as text:

*.h text
*.cpp text

I hope that helps! Let us know if you have more questions.