I'm trying to use Git and GitHub to sync a number of app configuration files. These are XML or plist files stored in a binary format. For example, a Keyboard Maestro .kmsync
file.
I can open these files via a text editor to see an XML format.
But when I view these file diffs in a GitHub Pull Request, commit view, etc. I see a useless binary diff with no visible changes:
Showing with 0 additions and 0 deletions.
BIN +17 Bytes (100%)
Binary file not shown.
I can get the a text-based diff to display locally via git via a .gitattributes
file. However, it appears that GitHub doesn't respect these modifications:
GitHub doesn't use .gitattributes files for choosing which files to show in a diff, so it's not possible to get around this that way. [source]
I want to see the text-based changes and line diffs when I view these files on GitHub in my commits and Pull Requests.
For example, the GitHub PR here. Feel free to fork and experiment:
https://github.com/pkamb/so/pull/1
How can I convince the web view of a GitHub repo to use text-based diffing for certain "binary" files?
I cannot find an existing question for my specific ask (displaying a non-binary diff on GitHub).
The following questions relate to for this same behavior, but for local git
(not GitHub).
- Override git's choice of binary file to text
- How would you put an AppleScript script under version control?
My question is the opposite of this question, which seeks to display text files as binary files on GitHub: