How does Github for Desktop History works?

Working for some time now with GitHub, lately I do experience some strange behavior. On repositories, on which I work already for some time, I can not see file differences (History> select an modified file> [panel with a link asking opening in an external program] If I click on that link the only thing that happens is github for desktop is opening this file as a movie which can’t be played because it is a Typescript file, if needed I can supply a gif file. Because I am new here I am allowed only one embedded file. However on a new added repository yesterday I can see file differences on the history tab > modified file > panel with changes; screenshot is also self explanatory enough

Thanks for any advice or reply

1 Like

Welcome @kwhjvdkamp. I’m not sure why that Typescript file is being detected as binary – is the file encoded in UTF-8? Different encodings can cause Git to detect files as binary. You can modify your the .gitattributes file in the repository to force Git to diff the file as text. Here’s how to do that:

  1. Go to Repository > Open in Explorer
  2. Open the hidden .gitattributes file
  3. Add the following line:

.ts diff

That should force Git to diff the .ts file. Let me know if it doesn’t get things working for you.

1 Like

Hi Steve Ward,
Thanks for your reply. I mean it! Also, my apology for responding a bit late.

First try, unfortunately, your suggesting did not solve the problem, but… it seems an asterik needs to be placed in front of ‘.ts diff’

Does NOT work: .ts diff

Does work: * .ts diff

I do not understand why this suddenly happend. Another thing thats wonders me is you talked about ‘hidden’ .gitattributes file. But those aren’t hidden, each repos has it own .gitattributes file, does it? So, it needs to be added everywhere… ???

With regards,

Koen

1 Like

@kwhjvdkamp apologies, I thought I included a * which indicated it will diff all files of the .ts type.

Another thing thats wonders me is you talked about ‘ hidden ’ .gitattributes file. But those aren’t hidden, each repos has it own .gitattributes file, does it?

A .gitattributes file is created by default, but it is not visible unless you enable the option to view hidden files and folders on Windows. This is the case with all dotfiles.

So, it needs to be added everywhere… ???

You can add a global .gitattributes file in the root of your user directory (the same location as your .gitconfig). The man page has further details about this. I hope that helps!

1 Like