Skip to content

Set consistent line endings #1691

@o-sapov

Description

@o-sapov

When working with the repository on different platforms, there are problems with line ending consistency, which causes Git to show irrelevant changes, which is inconvenient.

This could be improved by setting line endings for the project using the .gitattributes file.

Here is an example of a basic configuration: This sets the line endings to the Windows style for all text files and identifies binary files, such as images.

* text=auto eol=crlf
# Pictures
*.png binary
*.jpg binary
*.gif binary
*.svg binary
# Documents
*.pdf binary

I had a good experience with this setup when I was primarily developing on Windows, but also checking out the repository on a Linux server. However, the music-encoding repository has a different setup involving GitHub Actions. In this case, probably it would be better to set the line endings to the Linux style. This is also recommended by deepwiki . Some other considerations might be needed.

Here are also pros and cons from chatgpt: https://chatgpt.com/s/t_6867898361ec819193b4b7ab89c43247

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions