Last active
January 24, 2016 00:52
-
-
Save emichael/6bc89112d03a8c50f96e to your computer and use it in GitHub Desktop.
Normalize line endings in a git repo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "* text=auto" >> .gitattributes | |
git add .gitattributes | |
git commit -m "Adding line endings settings" | |
git rm --cached -r . | |
git reset --hard | |
git add . | |
git commit -m "Normalize line endings" | |
git rm --cached -r . | |
git reset --hard | |
# This command should now return nothing | |
find . -not -type d -exec file "{}" ";" | grep CRLF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment