2

I'm about to put a android project into a git repository, but I am a little uncertain about the line endings

My this project currently lives on windows, so autocrlf is set to true, but when I did the initial commit i got the following warnings:

warning: LF will be replaced by CRLF in /project/file.name The file will have its original line endings in your working directory.

First, how come certain files are LF when i'm on windows :-S? Is this because android is linux based and expect them to be LF rather than CRLF? Secondly, how come it wants to commit them as CRLF? I thought it "autocrlf true" is supposed to checkout as windows, but check-in as UNIX?

In summery, I want to be able to use both my mac, linux and windows machines to work on this project. Whats the best procedure to accomblish this? (I always just used "autocrlf input" for mac/linux and "autocrlf true" for windows in the past and I haven't had any issues, but this is my first android project I am going to put in GIT, and it seems to behave differently)

JustDanyul
  • 13,813
  • 7
  • 53
  • 71

1 Answers1

1

Simply don't bother with autocrlf: keep it to false.
See also "How line ending conversions work with git core.autocrlf between different operating systems".

If you use editors which doesn't change EOLs, you can work entirely with LF eol style accross platform.

If you fnd some files for which you have to enforce eol, use a gitattribute eol directive.
See "Distributing git configuration with the code".

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250