0

I have a repo with files that are encoded as UCS-2 by default. They're actually plain ASCII, but they are created by TestComplete tool and automatically set to that encoding. I tried many variants for setting those files to be text explicitly. I ended up with following string in .gitattributes file:

*.sj -crlf diff

(*.sj files are actually JS files for TestComplete) I can diff files ok (at least after git checkout HEAD --force . for the whole repository), i commit and see eg. 1 file changed, 2 insertions(+), 1 deletion(-) but when i do git push and try to view commits on GitHub they are shown as binary. I've seen many threads about setting vimdiff and such, but the problem seem to emerge somewhere else as i can see diffs, but github doesn't. And i use git on Windows.

What is wrong with my setup? What should i do to make github and git understand that .sj files are all text files and how can i make all those changes to take effect for all already added files?

EDIT: What i want is make git and github understand that those files are text ones and should be treated as that, even though previously they were considered binary. How to setup git/github?

4

1 回答 1

2

您可以让 TestComplete 以 ANSI 格式保存这些文件。为此,打开包含这些文件的 TestComplete 项目,打开项目设置窗口(工具 | 当前项目属性)并在常规部分中设置单位编码选项的ANSI值。在此之后,保存项目(File | Save All)。

此外,您可以从记事本中以 ANSI 编码保存文件。只需在记事本中打开一个文件并使用“另存为”对话框(文件|另存为)进行保存。您可以在此对话框的Enconding组合框中选择所需的编码。

于 2013-04-25T04:53:00.733 回答