change the filetype from binary to text after the file is commited to a git repo
- From
- tonka tonka <tonka3100@gmail.com>
- Date
- Jul 24, 2017, 05:11 UTC
- Message-ID
- <CAEor4NHDNL4CQP_FpCuJ_3F86-A3P8i=yvp1AZr-NKt0i1=cXw@mail.gmail.com>
Hey everybody,
I have a problem with an already committed file into my repo. This git repo was converted from svn to git some years ago. Last week I have change some lines in a file and I saw in the diff that it is marked as binary (it's a simple .cpp file). I think on the first commit it was detected as an utf-16 file (on windows). But no matter what I do I can't get it back to a "normal text" text file (git does not detect that), but I is now only utf-8. I also replace the whole content of the file with just 'a' and git say it's binary.
Is the only way to get it back to text-mode?: * copy a utf-8 version of the original file * delete the file * make a commit * add the old file as a new one
I think that will work but it will also break my history.
Is there a better way to get these behavior without losing history?
Best regards Tonka