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

Why doesn't git core.eol=lf work?

From
JCJason Cho <jason11choca@proton.me>
Date
Jul 12, 2025, 09:45 UTC
Message-ID
<QcbAE4JJXpU-NcQ1loYdHthi-nYA2ZXcuuetCHE_0N0fRi0mdaf90VaLk0Y2ehrnVzoZraYO7jLhB7Pl68_k4l3HCqkFVGuMOzZ26cHYkfc=@proton.me>
In-Reply-To
<8jPyf4EU-z7W6OHX4j_kba2G-1c2RIDtgBcSkFjWSNhMuE6pxOOyxSGBnguoZvuDQSaJPypH0u1vLJf6FBX_ahUn3bBO_1DVscfOQm4Jovw=@proton.me>
```MINGW64 /tmp/summer-temp/dbeaver/docs ((e4219ccb38...))
$ git log -1 --patch license_header.txt
commit b5121d4a6e8f3f21079920180b0fb14ada6d3349
Author: serge-rider <serge@jkiss.org>
Date:   Thu Jan 10 21:56:55 2019 +0300
    License header update (2019)
diff --git a/docs/license_header.txt b/docs/license_header.txt
index 86de505a18..d75b48e98e 100644
--- a/docs/license_header.txt
+++ b/docs/license_header.txt
@@ -1,5 +1,5 @@
    DBeaver - Universal Database Manager
-   Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
+   Copyright (C) 2010-2019 Serge Rider (serge@jkiss.org)^M

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.

MINGW64 /tmp/summer-temp/dbeaver/docs ((a3f59b66ed...))
$ git check-attr --all -- license_header.txt

MINGW64 /tmp/summer-temp/dbeaver/docs ((a3f59b66ed...))
$ rm license_header.txt

MINGW64 /tmp/summer-temp/dbeaver/docs ((a3f59b66ed...))
$ git -c core.autocrlf=false -c core.eol=lf checkout -f HEAD -- license_header.txt

MINGW64 /tmp/summer-temp/dbeaver/docs ((a3f59b66ed...))
$ cat -A license_header.txt
   DBeaver - Universal Database Manager^M$
   Copyright (C) 2010-2019 Serge Rider (serge@jkiss.org)^M$
^M$
   Licensed under the Apache License, Version 2.0 (the "License");^M$
   you may not use this file except in compliance with the License.^M$
   You may obtain a copy of the License at^M$

MINGW64 /tmp/summer-temp/dbeaver/docs ((a3f59b66ed...))
$ git --version
git version 2.47.0.windows.2
```

I ask git to force checkout license_header.txt with LF line ending, but `cat` tells me the file is checked out with CRLF. Why?
Next: Torsten Bögershausen
Message 1 of 7 in “Why doesn't git core.eol=lf work?”
  1. Jason ChoJul 12, 2025
  2. Torsten BögershausenJul 12, 2025
  3. Jason ChoJul 12, 2025
  4. Johannes SixtJul 12, 2025
  5. Jason ChoJul 12, 2025
  6. Lidong YanJul 13, 2025
  7. Jason ChoJul 13, 2025

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.