Čamo
Čamo

Reputation: 4160

Git line endings in multi OS environment

I installed Linux Mint on PC and then I cloned git repository from Bitbucket to work on it. After some changes I did commit in my PhpStorm ide. During this commit git fired me a dialog about line endings. There were two options. If I remember

  1. create gitattribute file which handles line endings for project

  2. set global handler for line endings via command like core.autocrlf true

I selected global option but as I see it made all the project files changed. Now I am not sure what happens and if I can push it to server. What happens if somebody pulls it on Windows? Will make a merge? How to solve it?

Upvotes: 0

Views: 277

Answers (1)

Skurhse Rage
Skurhse Rage

Reputation: 1020

As per the git-config Documentation:

core.autocrlf

Setting this variable to "true" is almost the same as setting the text attribute to "auto" on all files except that text files are not guaranteed to be normalized: files that contain CRLF in the repository will not be touched. Use this setting if you want to have CRLF line endings in your working directory even though the repository does not have normalized line endings. This variable can be set to input, in which case no output conversion is performed.

Having core.autocrlf set to true means that git will conditionally convert line endings to CRLF in your working directory and to LF in your repository.

Please see: What's the best CRLF (carriage return, line feed) handling strategy with Git?

Upvotes: 1

Related Questions