Questions tagged [core.autocrlf]

core.autocrlf is a configuration setting for Git controlling automatic conversion of line endings.

core.autocrlf is a configuration setting for . It controls whether or not automatic conversion of line-endings should happen in the working directory.

In the manual for git-config, the option is described like this:

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.

133 questions
6
votes
1 answer

Line Endings: Git merge creates duplicates without conflict

Git Auto Merge Issue: When there is Same code committed in two different branches file with one of this branch code having extra CRLF/LF at start. While merging it auto merges the file creates duplicates without any conflict. Please advise…
Hmnshu
  • 230
  • 1
  • 4
  • 13
6
votes
2 answers

Override .gitattributes text=auto in Windows

This is pretty unintuitive: C:\python-tdl\examples\termbox>git config core.autocrlf false C:\python-tdl\examples\termbox>git commit termbox.py warning: LF will be replaced by CRLF in examples/termbox/termbox.py. The file will have its original line…
anatoly techtonik
  • 17,421
  • 8
  • 111
  • 131
6
votes
2 answers

Git with autocrlf=true checks out files with mixed line endings as-is

So, I always thought that with core.autocrlf=true Git replaces all LF endings with CRLF when checking out the file into the working directory. From the Git book: If you’re on a Windows machine, set it to true – this converts LF endings into CRLF…
sdds
  • 1,963
  • 2
  • 22
  • 31
6
votes
1 answer

Dealing with EOL characters in Cygwin Git and Git for Windows accessing the same repository

My autocrlf is equal to true. In my cygwin-shell git status gives me a correct list of all my changes. In Git Bash git status says I modified all files in the project. I also see this in Git GUI and the Changes-tab in IntelliJ. How is this possible,…
Arthur C
  • 1,114
  • 1
  • 11
  • 30
5
votes
2 answers

Not doing git CRLF conversion for .m matlab files?

Matlab .m files use the Unix LF line endings even on Windows. I'm look to set up the git config file so that the .m files are not converted back to CRLF as other regular text files would be (i.e. I am using LF as the default style within the repo,…
Philip Oakley
  • 11,745
  • 8
  • 42
  • 63
5
votes
1 answer

What is the differrence between `* text=auto` and `* text eol=lf` in .gitattributes?

I am looking again and again at the documentation of .gitattributes but I cannot find a clear answer on what is the differrence between these two: * text=auto * text eol=lf Also is text=auto intended only for use with * or it can also be used with…
Marinos An
  • 6,191
  • 2
  • 35
  • 68
5
votes
1 answer

Git with autocrlf=false still produces "warning: CRLF will be replaced by LF" messages

I am using Git version 1.9.1 on Ubuntu 14.04. I have tested the core.autocrlf behaviour in a fresh repo with a DOS-format and a Unix-format file and confirmed that git add with autocrlf=true does, as expected, produce a warning: LF will be replaced…
cjs
  • 21,799
  • 6
  • 79
  • 93
5
votes
1 answer

make sure files are converted CRLF into LF in an update hook- is there a performance hit?

There had been a lot of discussions about the core.autocrlf and core.safecrlf features in the current release and the next release. The question i have here relates to an environment where developers clone from a bare repository. During the clone…
Senthil A Kumar
  • 8,034
  • 13
  • 41
  • 53
5
votes
1 answer

How can I preserve line endings when I check out a single file to a different location with git?

I want to checkout a single file from a git repository to a different location (other than working dir) and leave my current working dir as it is. And I want git to checkout my file with correct line endings. I work on Windows but I have the same…
4
votes
1 answer

Why does Git want to correct my line endings to CRLF, even though I want them to be in LF?

Working with a relatively large project, the policy to checkout CRLF and commit LF is used. To do so my system uses: git config --global core.autocrlf true However when committing a file, in this case the .gitattributes file, a warning is…
Koenigsberg
  • 1,106
  • 1
  • 6
  • 19
4
votes
0 answers

Force LF line endings, and convert working directory without commit

Consider the following situation: A git repository exists, containing text files with both CRLF and LF line endings. I'd like to Enforce all future commits to be converted to LF Enforce all future clones to be checked out in LF Convert my local…
Julius Bullinger
  • 1,150
  • 11
  • 28
4
votes
1 answer

Is there any risk or disadvantages of using: git config --global core.autocrlf false

I am using Windows and PHPStorm IDE for web development. In Git Bash, when I want to add (git add . ) or commit - there would be hundreds of warnings like this: warning: LF will be replaced by CRLF in ... The file will have its original line endings…
PeraMika
  • 2,713
  • 6
  • 28
  • 57
4
votes
1 answer

Can git be configured to not perform autocrlf on certain files?

I am using git on a Java project which is deployed to Windows, Linux, and Mac clients. For this Java project, I also maintain *.sh scripts for running the compiled binaries on Mac/Linux and .exe/.bat files for running the compiled binaries on…
CodeBlind
  • 4,284
  • 1
  • 20
  • 34
4
votes
2 answers

.gitattributes with core.autocrlf unset

I have a .gitattributes file in my repository that looks like this * text=auto *.txt text I have unset core.autocrlf in the repository, global, and system settings. My understanding, based on the documentation for gitattributes, is that all files…
cleek
  • 876
  • 8
  • 15
3
votes
2 answers

/usr/bin/env: ‘bash\r’: No such file or directory

I am having an issue after setting up docker in Linux terminal in win10. When I am trying to build it shows following error. /usr/bin/env: ‘bash\r’: No such file or directory ERROR: Service 'magento2' failed to build: The command '/bin/sh -c…
Priyal
  • 311
  • 1
  • 4
  • 15
1 2
3
8 9