Clean and Smudge
You can use clean and smudge to compress your file. Normally, this isn’t necessary, since git will compress it internally, but since gitHub is acting weird, it may help. The main commands would be like:
git config filter.compress.clean gzip
git config filter.compress.smudge gzip -d
GitHub will see this as a compressed file, but on each computer, it will appear to be a text file.
See https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes for more details.
Alternatively, you could have clean post to an online pastebin, and smudge fetch from the pastebin, such as http://pastebin.com/. Many other combinations are possible with clean and smudge.