Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git repo in Dropbox, syncing on Linux and Windows, Whitespace issues

I have a git repo in my Dropbox, that syncs between a Linux and a windows machine. I work on both machines on text files (.cpp on linux and win, .tex/.txt on win). So, my editors and programs both write CRLF (the win programs) and LF (the linux programs) files, all programs understand all variants on reading.

I would like to tell git to correct everything to LF (I like it that way best). On both platforms.

Alas with all my tries of core.autocrlf=true/false/input and core.eol=lf I get all kinds of messages. "Will convert from LF to CRLF", "all files have changed" and so on. Currently I have

core.eol=lf
core.autocrlf=input

and I am on my windows machine.

When tomorrow everything is synced to my Linux machine, what will I see?

  • Will there be LFs (as I currently have here)?
  • Will I see that all files have changed?

I hope I finally understood everything, but I am really not sure. input? Sounds strange...

like image 698
towi Avatar asked Nov 15 '22 01:11

towi


1 Answers

It used to be that you had to have autocrlf set to true and that would do it. Currently, you should have it set to input. Then depending whether you are in linux or windows you set the eol setting differently.

To double check your settings a diff will show crlfs in the repository.

Also, edit the files with vim -b, this will show the line endings too.

Hope this helps.

like image 192
Adam Dymitruk Avatar answered Dec 09 '22 08:12

Adam Dymitruk