Skip to content

Instantly share code, notes, and snippets.

@Muspi
Last active February 23, 2017 10:32
Show Gist options
  • Save Muspi/2e728a5e8a5729497d05ff38ca9d582c to your computer and use it in GitHub Desktop.
Save Muspi/2e728a5e8a5729497d05ff38ca9d582c to your computer and use it in GitHub Desktop.
Resolve EOL problem between while working with git repos on Windows and Linux
#Put this file on the repo root directory
* text=auto eol=lf
# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary
*.jpeg binary
*.ttf binary
*.eot binary
*.otf binary
*.woff binary
*.psd binary
*.woff2 binary
*.eps binary
git add . -u
git commit -m "Sauvegarder vos modifications en cours"
# supprimer tous les fichiers versionnés dans git
git rm -r --cached .
# reprendre les fichiers tel qu'ils étaient avant la suppression.
C'est avec cette commande que git va changer toutes les EOF avec
ce que l'on a spécifié dans le .gitattributes
git checkout -- .
# Enregister le changement de ligne
git add .
$ git commit -m "Normalize all the line endings"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment