Skip to content

Cargo always writes lock file with Unix-style line endings #1722

@rschmitt

Description

@rschmitt

I've noticed that when developing on Windows, running pretty much any cargo command causes the Cargo.lock file to be rewritten with Unix-style line endings. This, in turn, causes it to show up as changed in git status. I'm currently working around this by adding the following line to .gitattributes:

Cargo.lock eol=lf

This forces git to check out Cargo.lock using Unix-style line endings, overriding the global config setting of core.crlf=auto. It prevents the diff/status noise, but it's still kind of annoying.

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