2

I have a problem with the line terminator CR LF.

before I had set line endings like No Set, but this did not allow me to load the files correctly on the remote git with a commit and push.

Remotely the file was loaded correctly but there was only the presence of LF and CR was missing

Example Upload pippi pluto CR LF

Commit and push git remote pippo pluto LF

I changed the setting line endings with:Checkout is-as, commit as-is core.autocrlf is set to false

Set config View

Now the file is loaded correctly ( line endings CR LF) on git remote through commit and push but only when the file is new

Old files remain with the problem of line termination ( only LF but missing CR ). Git does not allow me to reload the files with the correct terminators (CR LF) as git are identical but remotely is missing the terminator (only LF).

How can I force the re-upload of the incorrect files with correct file or of the whole directory containing these files (there are many files that have this problem) ?

thank you Best Regards

Bonni
  • 41
  • 2
  • 10

3 Answers3

4

For Git Extensions; Tools>>Settings>>Git>>Config

View Screenshot

m4n0
  • 29,823
  • 27
  • 76
  • 89
0

With the option you choose "Checkout is-as, commit as-is" (that I also recommend when using only one OS), git is no more touching/converting the files when commuting them.

So you have to do a massive correction of all files before committing them.

There are a lot of way to do it (not all perfect or convenient). Choose the one with tools you have:

Philippe
  • 28,207
  • 6
  • 54
  • 78
0

In .gitattributes file type *.yourextension -text to force all files with extension "yourextension", or type * -text instead of * text=auto

the path is marked for automatic end-of-line conversion. If Git decides that the content is text, its line endings are converted to LF on checkin. When the file has been committed with CRLF, no conversion is done.

Set to string value "auto"

referring to your

Old files remain with the problem...

So, you can also wrap into json and save the text "MyContent1\r\nMyContent2\nMyContent3"

iliyesku
  • 361
  • 2
  • 10