Questions tagged [core.autocrlf]
core.autocrlf is a configuration setting for Git controlling automatic conversion of line endings.
135
questions
0
votes
0
answers
79
views
Why does git show ^M on changed lines where no CR exists in file?
I am using nbdev, writing code in jupyter notebooks which is then converted to a standard python library. I'm developing across windows and Mac OS and likely eventually Linux.
nbdev adds ....
1
vote
1
answer
133
views
Does text=auto in .gitattributes always enforce LF line endings and ignore Git's core.autocrlf and core.eol settings?
This is essentially a follow-up to the question asked here about the difference between * text=auto and * text=auto eol=lf in a .gitattributes config: What is the difference between "* text=auto&...
0
votes
1
answer
45
views
Git - output changes without modification
I've just cloned my repository from my Bitbucket repository, however I am getting a lot files with changes in stage to commit.
However, there are changes, like in this example:
I have hidden the DB ...
-2
votes
1
answer
888
views
What is CRLF and LF? What's the use case in Git?
I am new exploring git commands and suddenly found LF and CRLF. When run the command git add the terminal shows the below:
LF will be replaced by CRLF in app.js.
The file will have its original line ...
0
votes
1
answer
161
views
Line ending for asset files in Docker container
I have copied my git project into a Docker container.
app/
.git/
src/
.gitattributes
At first, calling git status showed every single project file as modified. This was because my project ...
-1
votes
1
answer
91
views
Can't disable autocrlf using .gitattributes
I have a directory called "test" in which I've placed some text files with various line endings. The trouble is Git for Windows insists on converting the file with LF line endings to CRLF ...
0
votes
0
answers
36
views
git arbitrarily picks line-ending settings
git config core.autocrlf returns true and my repository contains a .gitattributes that contains * text=auto.
However, I have noticed that some files are stored with LF line-endings as expected, and ...
0
votes
1
answer
24
views
Recover blobs which are falsely line-ending converted with git
I have a history in git, where in a commit A we have a .gitattributes files with
* text eol=lf
which is clearly wrong because it will convert all paths to LF even binaries before checkin.
So that ...
0
votes
0
answers
203
views
I need a git command to convert file line ending in Macintosh (CR) to Windows (CRLF) in windows
git config --global core.autocrlf true command is not helping.
Also if there is a python script which can change the line endings for multiple files together, it will help.
1
vote
1
answer
797
views
How to commit files to git with line separator changed (getting 'nothing to commit')
I need to update some files for a pull request so that they have matching line separators to the rest of the project. I've changed these files from LF to CRLF in notepad++ (couldn't figure out how to ...
1
vote
1
answer
261
views
git: always force windows line endings for repo
I want to force my repo to always use windows line endings, regardless of the user's environment or the setting of core.autocrlf. I've read about using .gitattributes to set the line endings, but ...
-1
votes
1
answer
31
views
How to set line-endings in git for local copy
I'm working on a project where we pull repos then check for various legal issues. I cannot modify the external projects, but do have complete control over my local machine (Ubuntu). Am running into ...
0
votes
0
answers
175
views
Disable safecrlf for particular file
I'm using Windows. I have the following settings in my ~/.gitconfig:
[core]
autocrlf = input
safecrlf = true
I have three files for my example repository: lf.txt with LF line endings; crlf....
1
vote
1
answer
3k
views
VSCode changing CRFL to LF on file save, and git records a change even if there is none
I've noticed a weird behavior in VSCode, when I save a file, even if I don't make any change, I can see in the low right corner that it changes from CRLF to LF. Even if I make several changes, git ...
2
votes
2
answers
464
views
How to git commit some files with CRLF and others with LF on Mac?
I have a repo that contains 7 files with CRLF and everything else with LF. I'm working on a mac which, by default, uses LF.
When I commit my changes on git and push it to Github, and my colleague ...
0
votes
0
answers
124
views
Handling CRLF on a per project basis in Windows 10 / WSL with git? [duplicate]
I got the following warning when trying to add my .rdl file to a project in git:
leeand00@SOMEWINBOX:/mnt/c/Users/leeand00/source/repos/ProdCompsFromCAPSReport$ git add ./ProdCompsFromCAPSReport/...
1
vote
1
answer
3k
views
NPM Package - LF or CRLF or auto line endings?
I'm the developer of an NPM package, and am trying to normalize line endings. I'm on a Windows machine with VSCode, so most of my files are in CRLF format. However, minified and sourcemap files ...
13
votes
2
answers
2k
views
Do I really need to specify all binary files in .gitattributes
I've read Git documentation that shows that I can explicitly set certain files to be treated as text, so their line endings are automatically changed or as binary to ensure that they are untouched.
...
0
votes
1
answer
181
views
Does git takes into account my .gitattributes for *.vbs text eol=crlf?
I'm currently working on VBScript (*.vbs) files, meant to be run on Windows only.
I want them to be checkout with CRLF disregarding of how developers have set their core.autocrlf. BTW, mine seems set ...
2
votes
3
answers
517
views
Git can't check out on Linux with LF a file that was stored with CRLF
I am checking out a third party project "libjpeg" from https://github.com/winlibs/libjpeg on Linux (it is just one example, actually I have the same problem with many other projects as well). I have ...
9
votes
3
answers
27k
views
/usr/bin/env: ‘bash\r’: No such file or directory [duplicate]
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' ...
5
votes
1
answer
3k
views
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 ...
0
votes
2
answers
628
views
git wants to change LF to CRLF on windows - how do I fix this?
In this answer, I found the following chart:
How autocrlf works:
core.autocrlf=true: core.autocrlf=input: core.autocrlf=false:
repo repo ...
2
votes
1
answer
1k
views
when git core.autocrlf is set to input what do we really have
I have several shell scripts in a project. In windows, every time I have it in LF and commit, git client would turn local files into CRLF: I believe both local and git repository have the same CRLF ...
0
votes
1
answer
41
views
git svn introducing carriage returns?
So I'm currently trying to merge code from a git repo into my svn repo using git-svn. My code inside the svn repo was developed on linux and does not have any carriage returns, and I believe the code ...
4
votes
0
answers
179
views
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 ...
0
votes
2
answers
924
views
Checking for line separator issue git?
I'm using PhpStorm and I did some work locally which I want to push to repo but I'm seeing this message and commit + push isn't working!
When I select files and hit commit or commit & push I get ...
1
vote
0
answers
55
views
Git auto transform html file lf to crlf
when git push file ,All html was transformed ,Only html file,Git transform LF to CRLF
My git config:
$ git config --global --list
user.email=xxx@163.com
user.ename=Jarrem
core.longpaths=true
core....
10
votes
1
answer
9k
views
git add throws warning "CRLF will be replaced by LF in <file-name>"
I started working on a Xamarin crossplatform development recently. While some of devs in my team are using Mac for development (with Visual Studio for Mac), others are using Windows (with Visual ...
19
votes
1
answer
2k
views
How to express core.autocrlf = false with .gitattributes?
This is amazing. With a gazillion posts on the Internet about core.autocrlf and .gitattributes I am still unable to figure out what to write in .gitattributes to express core.autocrlf = false
Can ...
0
votes
0
answers
610
views
Git: File line ending (LF/CRLF)
I use the git module inside the Android Studio to work with my repository. Some files are versioned without any changes and it says:
Contents have differences only in line separators
After ...
3
votes
2
answers
3k
views
How to force git commit with CRLF?
If I use autocrlf, it looks like here
push clone
1) true: x -> LF -> CRLF
2) input: x -> LF -> LF
3) false: x -> x -> x
...
2
votes
1
answer
476
views
Handeling line ending in GIT
Let's say we have team of 10 developers. Half of them use Windows and half Linux. All of them work together on a project, sharing work using GIT. Problem with CRLF/LF begins ...
Exmaple: One ...
3
votes
0
answers
272
views
How can I fix my line-endings mess?
Don't know how it happened, but on one machine (Windows), I have a personal.el file (text) with CRLF-Endings, while on the other it has LF endings. There might be a few other differences in this file ...
0
votes
0
answers
76
views
Does Git use the same heuristic for core.autocrlf and .gitattributes text=auto?
By adding * text=auto to a .gitattributes file, Git uses its own heuristic to determine if a file is text, as opposed to binary, for the purposes of line feed normalization. (source)
Presumably Git ...
0
votes
1
answer
92
views
How do I update local repo with "no changes" (End of line issue)
I work in a team in which everyone except me is working with Mac. I'm working with Windows 10.
I cloned the remote team repository and worked with it, when we realized there were problems with CRLF.
I ...
3
votes
1
answer
408
views
how to set git core.autocrlf for a submodule
Is it possible to configure core.autocrlf=false for a specific submodule?
I do not have push access for the submodule, so I need to set it from outside.
0
votes
1
answer
191
views
Find out if there are CRLF (i.e. \r\n) committed in the Git and which commits introduce them
Sometimes I find out that there are CRLF line-endings committed in Git history. The project has many teammembers, so I'd like to find which commits have been adding CRLF, so I can contact the authors (...
1
vote
1
answer
114
views
How to prevent Composer from using global core.autocrlf config on Windows
I have a private git repo configured in my composer.json file.
I am trying to require a package from it, however I want composer to checkout the repository with lf line endings.
I want to keep my ...
3
votes
3
answers
4k
views
`git` shows changed files after cloning, without any other actions
git clone git@github.com:erocarrera/pydot (35a8d858b) in a Debian with git config core.autocrlf input shows:
modified: test/graphs/b545.dot
modified: test/graphs/b993.dot
modified: test/graphs/...
1
vote
1
answer
138
views
Is core.autoclrf=true a superset of core.autocrlf=input?
From the documentation here: https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration#__code_core_autocrlf_code ,
I can conclude that core.autoclrf=true does exactly what core.autoclrf=input (...
2
votes
2
answers
1k
views
How can a file be committed with CRLF on git?
I have a repository containing 5 files that have been committed with CRLF. I don't know how this happened, but on a clean checkout if I use this command it prints 5 files (out of hundreds):
git grep ...
2
votes
3
answers
225
views
What does "check out code" mean in git documentation for line endings?
I'm really confused what "check out code" means in the following page: https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration#__code_core_autocrlf_code
If you’re on a Windows machine, set ...
9
votes
1
answer
3k
views
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 ...
1
vote
0
answers
682
views
Git: broken character encoding in cloned project
My goal: I want to to clone repository from Bitbucket using Git(Sourcetree).
My problem: I am able to finish cloning, but some source files in local project have broken encoding.
All files in ...
2
votes
1
answer
740
views
What does Git's auto-crlf setting actually do?
I have read plenty other questions pertaining to the auto-crlf setting in Git and I am not asking which auto-crlf setting I should be using, or how to normalize my line endings in a project. My ...
3
votes
2
answers
2k
views
git - CRLF issue in windows + linux dual boot
I'm going to answer my question with the fix what solved my problem.
Note for downvoters: I understand that the root cause is discussed in various other threads (that is how I solved my problem). ...
14
votes
4
answers
10k
views
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 ...
3
votes
1
answer
3k
views
Git autocrlf setting for mac and windows
Our team has people working on macs and windows. So far we had our git automatic line ending set to true (on OSX) and input (on Windows).
It works nice, unless there is a merge conflict. In this case ...
2
votes
1
answer
8k
views
git config core.autocrlf is true, but I'm still getting a warning?
I understand that Windows uses CRLF and that it's good practice to let Git change line endings to LF before committing and back to CRLF when checking out. For that reason, I have core.autocrlf set to ...