Code Monkey home page Code Monkey logo

Comments (6)

dscho avatar dscho commented on June 16, 2024

Cygwin tries very hard to make a Unix-like environment on Windows (and pays for it in performance), hence the default end-of-line character is a line feed there.

Git for Windows tries very hard to integrate with standard Windows, which uses DOS-style line endings, i.e. carriage return followed by a line feed.

You can easily change the setting if you want to deviate from the platform's default: Just have a look at the core.autocrlf variable in .git/config: changing it to false will tell Git to keep the line-endings identical between the working directory and the repository. Note: if you change the setting, you will most likely have to deal with your fellow developers yelling at you for committing DOS-line endings into the repository, because it will happen.

For details, search for core.autocrlf in http://kernel.org/pub/software/scm/git/docs/git-config.html.

from git.

ryenus avatar ryenus commented on June 16, 2024

@dscho yeah, I understand with my .gitattributes file, checking out files with cygwin git and msysgit might cause the files have different eols, but when commiting/normalizing, both platform should have the eols normalized to LF, right? but from warning it looks like msysgit tries to normalize the eols to CRLF, that's what I wish to be fixed. Thanks

from git.

dscho avatar dscho commented on June 16, 2024

@ryenus the warning is about the file, i.e. the working directory.

from git.

kusma avatar kusma commented on June 16, 2024

No. LF is simply wrong on Windows.

from git.

ryenus avatar ryenus commented on June 16, 2024

@kusma but according the manual, setting text to auto does mean to normalize all the eols to LF

Set to string value "auto"
When text is set to "auto", the path is marked for automatic end-of-line normalization. If git decides that the content is text, its line endings are normalized to LF on checkin.

and I do believe the point of this is to ensure true cross-platform support.

from git.

kusma avatar kusma commented on June 16, 2024

I was talking about the working directory, which is what the warning is about. Perhaps we could make the warning less confusing?

core.autocrlf normalize to LF in the repo, but it will also change the working-copy version to CRLF if it already contains LF-newlines.

from git.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.