4

Consider the following situation: A git repository exists, containing text files with both CRLF and LF line endings.

I'd like to

  1. Enforce all future commits to be converted to LF
  2. Enforce all future clones to be checked out in LF
  3. Convert my local index to only use LF see comments
  4. Convert my local working directory to only use LF

I can do 1. easily with * text=auto eof=lf in .gitattributes.

But is there any way to do 2. and 4. without a mass-change commit, and without affecting existing history?

I suppose converting the local index is not possible, but if 1. and 4. works, it shouldn't be required.

I've read and tried almost every combination of core.autocrlf, .gitattributes options, and git checkout/rm/checkout-index/reset permutation without success.

Julius Bullinger
  • 1,150
  • 11
  • 28
  • 2
    Given that the line endings are part of the content of your tree, I don't see how you can alter the tree _without_ a mass commit. – Jonah Bishop Mar 06 '19 at 02:18
  • @JonahBishop, that's what I figured. Thank you for confirming my suspicion, I have changed the question accordingly. – Julius Bullinger Mar 06 '19 at 06:47

0 Answers0