2

I've installed the latest version from git-scm.com on my Windows 8.1 System. My Dev Server is a Linux Server, but I'm connected to this server using a windows share.

After the git initalization, I've started to "add" files to the repositiory and received this message on the windows command line, for every file:

warning: LF will be replaced by CRLF in inc/src/tpl/default.smarty. The file will have its original line endings in your working directory.

While installing git I selected option 1 from this options:

  1. Checkout Windows-style, commit Unix-style line endings
  2. Checkout as-is, commit Unix-style line endings
  3. Checkout as-is, commit as-is

So I'm working on windows, commiting over a windows share to a linux server, and I will also push these changes to another linux server.

Now I'm a little bit unsure about this setting because I'm working on a linux server. The only windows "Thing" is my command line and that I'm editing the files using a windows share.

I would like to know, if this is the right setting for git, or if I'm doing it wrong.

Thanks

emjay
  • 1,491
  • 5
  • 17
  • 35

1 Answers1

0

I'm not 100% clear on your setup, but here is what is happening. The files you are adding have Unix-style line endings (i.e. they end with LF). Since you picked option 1, git is just warning you that when you check these files out on your Windows box, they will have Windows-style line endings (i.e. they will end with CRLF).

Normally this is nothing to worry about, but you mention that you "will also push these changes to another linux server." If by this you mean a git push, then no worries; the line endings will be normalized to Unix-style in the repository. However, if you mean that you copy the files from your Windows box to a Linux box, then you will eventually end up copying files with Windows-style line endings to the Linux box, which you probably don't want to do. If that is the case, you are probably better off with option 3. Note that if you edit these files on your Windows box, you may even want to go option 2, so that you will always have Unix-style line endings in the repository.

David Deutsch
  • 17,443
  • 4
  • 47
  • 54