Batch convert text files from LF line endings to CRLF

dos2unix, git

Solution

I missed the obvious way:

- git clone to folder A. git config core.autocrlf false

- git clone to folder B. git config core.autocrlf true

- delete all source files from folder B

- git checkout -f in folder B

- cut and paste all files and folders from folder B to folder A

- git commit in folder A

- git pull from the original repository

Problem

I have a vb.net (visual studio 2010) project that is version controlled with git (1.7.10.msysgit.1). I made a mistake of leaving `core.autocrlf` to true in git. Now I have set `core.autocrlf` to false, but the source code is already converted to LF line endings inside the repository. I want to change the line endings back to CRLF. My plan to correct the situation is: - git clone - delete all source code files in the clone - git checkout -f - convert all LF to CRLF - git commit - git pull from the original repo I am having problem with step 4. There are a lot of files in the project and hopefully there is a tool to batch convert all text files into CRLF line endings. I have tried `dos2unix` that is available in the git bash, but looks like it will not process subfolders and it told me that the text files `looks binary`. So, what is the best way to batch convert my source code back to CRLF line endings?

Original source