Created
November 6, 2013 23:11
-
-
Save ejhayes/7345900 to your computer and use it in GitHub Desktop.
Force line endings for a project to always be LF (*nix) and to automatically convert any encountered CRLF line endings to LF before making a commit. This is useful if you have a project that runs with vagrant on ubuntu, but you are doing development with windows.
This file contains hidden or 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
* text=auto | |
*.jpg binary | |
*.gif binary | |
*.png binary |
This file contains hidden or 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
#!/bin/bash | |
# This is useful for a project that is checked out on windows, but all files are run on a linux machine | |
# otherwise we run into an issue where windows line endings are seen on the linux side which sometimes | |
# causes unexpected behavior. | |
git config core.eol lf | |
git config core.autocrlf input | |
git rm --cached --rf . | |
git reset --hard | |
git commit -m "Normalize line endings." |
Comments are disabled for this gist.