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

Re: Git on Windows, CRLF issues

From
Peter Karlsson <peter@softwolves.pp.se>
Date
Apr 22, 2008, 06:52 UTC
Message-ID
<Pine.LNX.4.64.0804220749080.22731@ds9.cixit.se>
In-Reply-To
<m3bq42ri56.fsf@localhost.localdomain>
Jakub Narebski:
> I think you can, by unsetting `crlf` attribute, i.e. putting the
> following in .gitattributes:
> 
>    * -crlf

Yeah, that does indeed seem to work, no matter how core.autocrlf is configured globally. I think this is the best way to go for the repositories I am working on (as they are very much DOS/Windows-only).

Does anyone know how to hack an existing repository so that I can add such a .gitattributes file to all commits? I've tried reading the git-filter-branch manual page a few times, but I am still confused by it.

I guess I need some combination of "git filter-branch --tree-filter" and "git update-index --add".

It doesn't matter much that the all commits are re-written, as I am still the only one to have cloned them.

-- 
\\// Peter - http://www.softwolves.pp.se/
Previous: Jakub NarebskiNext: Johannes Sixt
Message 27 of 30 in “Git on Windows, CRLF issues”
  1. Peter KarlssonApr 21, 2008
  2. Johannes SchindelinApr 21, 2008
  3. Avery PennarunApr 21, 2008
  4. Jeff KingApr 22, 2008
  5. Avery PennarunApr 22, 2008
  6. Peter KarlssonApr 23, 2008
  7. Jeff KingApr 23, 2008
  8. Peter KarlssonApr 23, 2008
  9. Johan HerlandApr 23, 2008
  10. Johannes SixtApr 23, 2008
  11. Jeff KingApr 23, 2008
  12. Johannes SchindelinApr 23, 2008
  13. Jeff KingApr 23, 2008
  14. Johannes SixtApr 23, 2008
  15. Jeff KingApr 23, 2008
  16. Johannes SixtApr 23, 2008
  17. Jeff KingApr 23, 2008
  18. Junio C HamanoApr 23, 2008
  19. Avery PennarunApr 23, 2008
  20. Johannes SchindelinApr 24, 2008
  21. Avery PennarunApr 24, 2008
  22. Jeff KingApr 24, 2008
  23. Avery PennarunApr 23, 2008
  24. Johannes SixtApr 24, 2008
  25. Johannes SixtApr 22, 2008
  26. Jakub NarebskiApr 21, 2008
  27. Peter KarlssonApr 22, 2008
  28. Johannes SixtApr 22, 2008
  29. Johannes SixtApr 22, 2008
  30. Peter KarlssonApr 22, 2008

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.