I have just one cs file in my repository which Git seems to think is binary. (In git gui
, it just says "binary files differ".)
How can I indicate to Git that my cs file is a text file?
gitattributes has a new working-tree-encoding attribute. As mentioned in "Set file as non-binary in git": "Why is Git marking my file as binary?" The answer is because it's seeing a NUL (0) byte somewhere within the first 8000 characters of the file.
Git LFS is a Git extension used to manage large files and binary files in a separate Git repository. Most projects today have both code and binary assets. And storing large binary files in Git repositories can be a bottleneck for Git users. That's why some Git users add Git Large File Storage (LFS).
Git can usually detect binary files automatically. No, Git will attempt to store delta-based changesets if it's less expensive to (not always the case). Submodules are used if you want to reference other Git repositories within your project.
Any binary format can be diffed with git, as long as there's a tool which converts the binary format to plain text. One just needs to add the conversion handlers and attributes in the same way.
You could try and set your cs files as text in a .gitattributes
file.
*.vmc diff
(as described in the .gitattributes
man page)
or try to diff them as text (git diff --text
)
But if your .cs files are UTF-8 or UTF-16, this can be problematic, unless you set your diff
to use an external tool able to handle those encoding.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With