git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Automatic core.autocrlf?

From
Torsten Bögershausen <tboegi@web.de>
Date
Aug 27, 2018, 15:35 UTC
Message-ID
<20180827153524.GA18025@tor.lan>
In-Reply-To
<CAHd499APYCH2r2=+M_AGKUzN0GDmrwDty4wK=Xy-utCdMrd56w@mail.gmail.com>
On Mon, Aug 27, 2018 at 09:10:33AM -0500, Robert Dailey wrote:
Show 11 quoted lines
> Is there an 'auto' setting for the 'core.autocrlf' config? Reason I
> ask is, I want that setting to be 'input' on linux but 'true' on
> Windows. I have a global .gitconfig that I sync across different
> platforms with Google Drive, and I hate to manage 2 copies of it on
> each platform (linux and Windows). If there's some way to make the
> line ending configuration the same between both, that would be
> awesome.
> 
> Note that I do rely mostly on git attributes files for this, however
> not all upstream repositories have one, and I don't always have
> permission to create one there.

How many repos do you look at, and how big is the "pain level" here? Would it be possible to submit pull-requests ?

> In those cases, when it falls back to
> configuration for line ending management, I want it to be
> automatically configured based on the host platform.

There is git config core.eol native

But that is already the default, and it needs the 'text' attribute
to be set (or auto), the simplest solution is to have
* text=auto
in .gitattributes
> 
> Any advice is appreciated here. Unfortunately Google isn't much help
> on this topic, Stack Overflow is a swamp full of different information
> and none of it seems authoritative.

Out of interest, not to blame anybody: Did you ever look at

https://git-scm.com/docs/git-config

The authoritative answer is in the Git project itself, under Documentation/config.txt

In summary, if I understand you right, the solution would be to use .gitattributes in every project.

HTH
Previous: Robert DaileyNext: Duy Nguyen
Message 2 of 15 in “Automatic core.autocrlf?”
  1. Robert DaileyAug 27, 2018
  2. Torsten BögershausenAug 27, 2018
  3. Duy NguyenAug 27, 2018
  4. Robert DaileyAug 27, 2018
  5. Andrei RybakAug 27, 2018
  6. Andrei RybakAug 27, 2018
  7. brian m. carlsonAug 28, 2018
  8. Robert DaileyAug 30, 2018
  9. Jonathan NiederAug 30, 2018
  10. Robert DaileyAug 30, 2018
  11. Torsten BögershausenAug 30, 2018
  12. Randall S. BeckerAug 30, 2018
  13. Jonathan NiederAug 31, 2018
  14. Randall S. BeckerAug 31, 2018
  15. Torsten BögershausenAug 31, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.