Harmonisez les fins de ligne et évitez le bruit sur les binaires.
objectifs d’apprentissage
- Créer .gitattributes.
- Renormaliser.
- Traiter *.sh en lf.
prérequis
- Repo existant.
- Notion EOL.
notions clés
- text eol=lf.
- binary.
- merge strategy.
démonstration guidée
étape 1
Règles .gitattributes.
* text=auto eol=lf
*.png binary
*.jpg binary
étape 2
Renormaliser.
git add --renormalize .
git commit -m "chore: renormaliser fins de ligne"
exercice
Ajoutez la règle pour *.sh et vérifiez git diff.
correction
Règle .sh.
*.sh text eol=lf
quiz éclair
- Quelle config force LF ?
- a) text=auto eol=lf
- b) binary=on
- c) eol=crlf