我有一个vb.net(visual studio 2010)项目,使用git(1.7.10.msysgit.1)进行版本控制.我犯了一个错误,core.autocrlf在git 中留下真实.现在我设置core.autocrlf为false,但源代码已经转换为存储库内的LF行结尾.我想将行结尾更改回CRLF.
我纠正这种情况的计划是:
我遇到了第4步的问题.项目中有很多文件,希望有一个工具可以将所有文本文件批量转换为CRLF行结尾.
我试过dos2unix在git bash中可用,但看起来它不会处理子文件夹,它告诉我文本文件looks binary.
那么,将源代码批量转换回CRLF行结尾的最佳方法是什么?
我采用了Endy的步骤,但将其简化为仅使用一个存储库:
1. git config core.autocrlf true
2. delete all files in your working tree (except the .git folder for sure)
3. git checkout -f
4. git config core.autocrlf false
5. git commit -am "corrected all line endings from LF to CRLF"
Run Code Online (Sandbox Code Playgroud)
我错过了明显的方法: