• Line endings for Drupal in git

    Rather than using

    git config core.autocrlf input

    to control line endings, which has to be done per-user and feels a bit magical (i.e. I don’t really understand what it’s doing), you can set them on a per-repository and per file type basis. This avoids problems with users having different configurations and with git incorrectly guessing whether a file is text or binary.

    All you need to do is put an appropriate .gitattributes file in the root of your repository. Drupal 8 will ship with one, and it should work well for Drupal 7 too. You can download it from:

    http://drupalcode.org/project/drupal.git/blob_plain/refs/heads/8.x:/.gitattributes

    Categories: Drupal

    Tags: ,