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
232
votes
8 answers

How line ending conversions work with git core.autocrlf between different operating systems

I've read a lot of different questions and answers on Stack Overflow as well as git documentation on how the core.autocrlf setting works. This is my understanding from what I've read: Unix and Mac OSX (pre-OSX uses CR) clients use LF line…
Michael Maddox
  • 11,633
  • 5
  • 35
  • 39
118
votes
2 answers

How do I force git to checkout the master branch and remove carriage returns after I've normalized files using the "text" attribute?

Okay, so I added the file .gitattributes with lines like this *.css text *.js text etc... I then followed the instructions at http://git-scm.com/docs/gitattributes#_checking-out_and_checking-in $ rm .git/index # Remove the index to force Git…
Jason
  • 10,225
  • 8
  • 57
  • 79
111
votes
10 answers

env: bash\r: No such file or directory

I'm trying to install YouCompleteMe from here. When I execute: ./install.sh --clang-completer I get this error: env: bash\r: No such file or directory I don't know what's wrong with environment variables. Here's my bash path: which bash…
Brijesh Rakholia
  • 1,215
  • 2
  • 9
  • 6
74
votes
3 answers

Git on Windows: What do the crlf settings mean?

I don't understand the complexities related to CrLf settings in git: core.autocrlf, core.safecrlf I'm developing a cross-platform project in a team and would like both Windows and Linux developers to be able to work together without git marking…
Jonathan
  • 84,911
  • 94
  • 244
  • 345
65
votes
1 answer

How to to disable Git end-of-line (CRLF to LF) across all clones/machines?

As one can glean from other posts, Git's end-of-line normalization has its pros and cons. I have one particular Windows-only project where I think the best thing to do is to is to disable end-of-line normalization altogether. That is, I want to…
Chris
  • 9,496
  • 6
  • 43
  • 55
48
votes
3 answers

Why is 'Updating the Git index failed' displayed

I am using Windows. When staging files I get this error. Updating the Git index failed. A rescan will be automatically started to resynchronize git-gui. followed by a list of files which have been converted from LF to CRLF After a lot of reading up…
byronyasgur
  • 4,299
  • 11
  • 47
  • 93
40
votes
4 answers

Git, adding files to repository gives fatal error for LF ->CRLF

I'm new to git and I need some help. I'm using msysgit on windows. When I execute the command git add [folderName] I get the response: fatal: LF would be replaced by CRLF in [.css file or .js file] and then if you try to do a commit nothing…
user619656
  • 789
  • 2
  • 11
  • 17
37
votes
6 answers

git status shows modifications even with autocrlf=false

I'm experiencing the same issues as in this question: git status shows modifications, git checkout -- doesn't remove them Git continues to show working directory modifications, even with git config --global core.autocrlf…
codekaizen
  • 25,796
  • 7
  • 81
  • 132
34
votes
1 answer

How does git-svn handle line endings?

I'm pretty happy with how Git itself handles line endings, via core.autocrlf, core.eol + gitattributes (Tim's post is excellent). I have a Windows Git repo that has autocrlf set to true. So, all text files are stored in the repo as LF and live in…
citizenmatt
  • 16,889
  • 5
  • 51
  • 54
30
votes
4 answers

Is there a way to determine the line endings in a existing git repo?

Is there a way to determine the line endings in a existing git repository? If I clone a existing repository how do I determine what core.autocrlf was used by the creator? I'm still uncertain whats the best setting for core.autocrlf e.g on a…
U. N. Owen
  • 301
  • 1
  • 3
  • 3
16
votes
2 answers

Git files modified after checkout, reset --hard, etc. even though autocrlf is set to false

Here is my system dialogue: unrollme-dev-dan:views Dan$ git reset --hard HEAD HEAD is now at 3f225e9 Fix scan titles unrollme-dev-dan:views Dan$ git status # On branch master # Changes not staged for commit: # (use "git add ..." to update…
djechlin
  • 54,898
  • 29
  • 144
  • 264
14
votes
2 answers

Git core.safecrlf different behavior on files with same line endings

I have Windows machine with VS project and I use both Visual Studio and tools from Cygwin environment including Git. Sometimes I get different line endings in files after editing. I want simple solution to check files' line ending consistency before…
Rast
  • 1,744
  • 2
  • 15
  • 24
13
votes
3 answers

Android Studio - CRLF vs LF for a Git-based multiplatform project

I'm working on an Android project involving multiple developers, some of which are on Windows, others Linux/MacOS. Since I'm on Windows, I've been instructed to configure Git as follows to avoid issues: autocrlf = true safecrlf = true This works…
PM4
  • 426
  • 3
  • 13
12
votes
2 answers

How to repair CRLF in GIT repository to avoid merge conflicts

I created my repo with autocrlf=true and then made some checkouts and commits with autocrlf=false. Then switched back to autocrlf=true (OS Win). Everything seemed to be OK, until I started some merges between branches. Many merge conflicts arose,…
Andik
  • 119
  • 1
  • 5
12
votes
1 answer

does a git repository have its own local value for core.autocrlf that overrides the global one?

As per this question, I understand that core.autocrlf=true in git will cause CRLF to LF translations. However when I type : git config core.autocrlf I see: false However, when I stage modified files that are already in the repo, I still…
Warren P
  • 58,696
  • 38
  • 168
  • 301
1
2 3
8 9