I can confirm this is related to GIT.
You can set git config --global core.autocrlf input
to convert all CRLF to LF on committing.
This means that Git will process all text files and make sure that CRLF is replaced with LF when writing that file to the object database. It will not, however, do the reverse. When you read files back out of the object database and write them into the working directory they will still have LFs to denote the end of line. This setting is generally used on Unix/Linux/OS X to prevent CRLFs from getting written into the repository. The idea being that if you pasted code from a web browser and accidentally got CRLFs into one of your files, Git would make sure they were replaced with LFs when you wrote to the object database.
There is also a per-repository setting where you can declare line endings for specific files. Therefore a .gitattributes
file must be created in your repo. For some examples see https://help.github.com/articles/dealing-with-line-endings/#per-repository-settings. The advantage of the per-repository setting is that every user who pulls from your repo has the same line ending settings.
Since any good windows editor should support both CRLF and LF I see no problem with using LF only.
Difference between dist and source
Run composer show laravel/laravel
and you can see
source : [git] https://github.com/laravel/laravel.git 4afcd8c278febbe6840dbf8bbb46514818abce59
dist : [zip] https://api.github.com/repos/laravel/laravel/zipball/4afcd8c278febbe6840dbf8bbb46514818abce59 4afcd8c278febbe6840dbf8bbb46514818abce59
The composer option --prefer-dist
is a non version control zip archive. Mostly this is the faster way than source
and default for stable versions.
If --prefer-source
is used composer will clone from the git repository. Because you are not on a stable version source
is used if you omit --prefer-dist
.
Why dist is LF
The zip archive is downloaded and extracted. No git actions are performed the line feed is obtained as provided in the repo/zip.
Why source is CRLF
The git repository is cloned and checked out from github.
The laravel repository has a .gitattributes
file containing
* text=auto
- Note:
.gitattributes
has higher priority than git config
* text=auto
will make Git handle the files in whatever way it thinks is best. Now you are on Windows and Git thinks it is best to change it to CRLF as this is the default for Windows I think.