Skip to content

Instantly share code, notes, and snippets.

@senmu
Created September 7, 2011 22:25
Show Gist options
  • Save senmu/1201985 to your computer and use it in GitHub Desktop.
Save senmu/1201985 to your computer and use it in GitHub Desktop.
Recursively convert Windows CR+LF to Unix LF in bash
# The following command can be entered in the terminal to convert files in the current directory
# to Unix LF which comes in handy when trying to add code to a git repo and you are faced with
# the error: fatal: CRLF would be replaced by LF
find . -name *.* -exec perl -pi -e 's/\r\n/\n/g' {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment