Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7747313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:29:54+00:00 2026-06-01T10:29:54+00:00

As one can glean from other posts , Git’s end-of-line normalization has its pros

  • 0

As one can glean from other posts, Git’s end-of-line normalization has its pros and cons. I have one particular Windows-only project where I think the best thing to do is to is to disable end-of-line normalization altogether. That is, I want to leave all newlines (most of which are CRLF) intact, rather than have git normalize them to LF-only behind the scenes, and I want that change to affect all clones of the repository on all machines. The question is the most effective way to do it.

Most discussions of Git end-of-line normalization are in terms of core.autocrlf, and I could accomplish my goal by setting core.autocrlf=false. However, this is a git-config setting, and I believe one has to set that separately on each machine by machine. If true, that seems error prone, especially since the msysgit installer guides one into setting core.autocrlf=true.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T10:29:55+00:00Added an answer on June 1, 2026 at 10:29 am

    The best way to avoid having to set core.autocrlf separately on each machine seems to be checking a .gitattributes file into the repository containing the single line

    * -text
    

    Or, if you have an older version of Git then

    * -crlf
    

    This tells Git that, for all paths (thus the *), end-of-line normalization should not be attempted. As far as I can tell, this should not have any other side-effects. In particular, it should not alter how diffs are generated (this has separate attribute diff/-diff) or how merges are handled (this has a separate attribute merge/-merge).

    For more details, I suggest these resources:

    1. The gitattributes documentation (git help attributes or an online copy) , which describes in detail both how end-of-line normalization works and the particular effects of different attributes. (Probably most relevant are text, crlf, diff, merge, and binary.)
    2. Git mailing list thread Is the "text" attribute meant only to specify end-of-line normalization behavior, or does it have broader implications? (Mar 30, 2012), which expands on the meaning of different attributes, and clarifies that -text does not mean simply "this is a binary file".
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How one can move blog posts from blogging engine to another? Is there away
Can we prove that one can unambiguously construct a binary tree from its in-order
One can send messages to an AT&T customer via [10-digit-cell-numer]@txt.att.net from their email client.
One can, of course, use fopen or any other large number of APIs available
One can add a tableviewcell in the nib of its tableviewcontroller, but how do
One can get an element from std::tuple by index using std::get . Analogically, how
One can remove all calls to printf() using #define printf . What if I
One can create an anonymous object that is initialized through constructor parameters, such as
One can tag files and folders with a color in the Mac OS X
One can create a SeekBar in XML as follows... <SeekBar xmlns:android=http://schemas.android.com/apk/res/android android:id=@+id/bpseekbar android:layout_width=fill_parent android:layout_height=wrap_content

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.