1

I have a repository checked out on a windows machine, but it has CRLF newlines in every file. I would like to check this repository out with Unix format LF only instead. I've changed the setting on tortoise git to disable changing newlines to the Windows format, but how to I get it to actually update the newlines in my checkout to LF?

I'm in this pickle because I have some changes I've made and committed to one repository on my windows machine that I would like to copy to another repository on my Linux machine. The repositories are not easily comparable / have no commits in exact sync with each other, so I'd just like to delete all the files and copy in the updated versions. For ease of viewing the git history, I don't want every file to be marked as changed. The commit should be a reasonably nice diff between the copied in files and the previous commit.

Andy
  • 237
  • 3
  • 14
  • 1
    See *all* the answers to https://stackoverflow.com/questions/9976986/force-lf-eol-in-git-repo-and-working-copy (and, related but a side issue, [What will `* text=auto eol=lf` in gitattributes do?](https://stackoverflow.com/a/40977008/1256452)) – torek Feb 08 '19 at 01:09
  • Thanks. The magic command I was missing was "git checkout-index --force --all" which will actually switch the files over to the other format. – Andy Feb 08 '19 at 06:18
  • Interesting. I have had no luck with `git checkout-index -f` unless I touch the work-tree files first, myself. – torek Feb 08 '19 at 07:20

0 Answers0