Skip to content

Instantly share code, notes, and snippets.

@amalagaura
Created December 15, 2011 04:29
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save amalagaura/1479848 to your computer and use it in GitHub Desktop.
Save amalagaura/1479848 to your computer and use it in GitHub Desktop.
Commands to fix damn CRLF with rubymine saving in windows
# Remove everything from the index
git rm --cached -r .
# Re-add all the deleted files to the index
# You should get lots of messages like: "warning: CRLF will be replaced by LF in <file>."
git diff --cached --name-only -z | xargs -0 git add
# Commit
git commit -m "Fix CRLF"
# If you're doing this on a Unix/Mac OSX clone then optionally remove
# the working tree and re-check everything out with the correct line endings.
git ls-files -z | xargs -0 rm
git checkout .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment