Thread (6 messages) flat view 6 messages, 3 authors, 2016-06-15

Re: git adds some text file as binary file by mistake

From: Michael J Gruber <hidden>
Date: 2016-06-15 22:45:31

Ping Yin venit, vidit, dixit 24.10.2008 15:30:
On Fri, Oct 24, 2008 at 8:54 PM, Michael J Gruber
[off-list ref] wrote:
quoted
Ping Yin venit, vidit, dixit 24.10.2008 14:37:
quoted
So what should i do if i want it added as text file?
You should give us more detail on the file ;)
What's the extension, what's the typical content? It may be a simple
matter of specifying attributes.
Do ordinary diff and grep recognize your files as text?

Michael
It's just an xml file. I guess maybe there are some hidden characters
at the beginning. I will figure it out later because i have no access
to that file right now.
Maybe it's in an encoding which is not available on the machine you're
using git on?
I'm just ask this problem in general sense. So is there a general way
to specify whether  a file is text or binary?
Bruce suggested a good read. To save you some time: You want to say

*.xml diff

or

*.xml diff crlf

in one of the attributes files, depending on whether you want git to
possibly translate line endings (which depends on other settings also).
Note that the "content type" of the file plays a role only for diffs and
stats, not for the actual storage (except for, possibly, crlf conversion).

Cheers,
Michael
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help