Convert line-endings for whole directory tree (Git)

Following situation:

I’m working on a Mac running OS X and recently joined a project whose members so far all use Windows. One of my first tasks was to set up the codebase in a Git repository, so I pulled the directory tree from FTP and tried to check it into the Git repo I had prepared locally. When trying to do this, all I got was this

fatal: CRLF would be replaced by LF in blog/license.txt.

Since this affects all files below the “blog” folder, I’m looking for a way to conveniently convert ALL files in the tree to Unix line-endings. Is there a tool that does that out of the box or do I get scripting something myself?

For reference, my Git config concerning line-endings:

core.safecrlf=true
core.autocrlf=input

7 Answers
7

Leave a Comment