Skip to content

Instantly share code, notes, and snippets.

@esebastian
Created June 10, 2014 15:37
Show Gist options
  • Save esebastian/76b0f4c5191cf7829a71 to your computer and use it in GitHub Desktop.
Save esebastian/76b0f4c5191cf7829a71 to your computer and use it in GitHub Desktop.
Convert DOS CRLF newlines to Unix/Linux LF in all text files in a Git repo
git ls-files | xargs perl -le 'for (@ARGV) { print if -f && -T }' | xargs perl -pi -e 's/\r\n/\n/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment