How do I change the core.autocrlf to work with leap lines LF in git?

7

I am encountering a problem with git and Windows . It turns out that the work team is working in linux and I find Windows , so when I do commit the line breaks that I take into account are the Windows and therefore the people make the Posts tells me that I should change this to Linux .

Searching in English OS, says just do:

git config --global core.autocrlf false

the configuration should be changed, but, for some reason, when I do it, it leaves me in true , in other words I do not see any effect. The complete code:

git config --global core.autocrlf false

C:\xampp\htdocs\DDDDD\public>git config --list
core.symlinks=false
core.autocrlf=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
help.format=html
http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
diff.astextplain.textconv=astextplain
rebase.autosquash=true
core.edito=atom --wait
core.autocrlf=false
push.default=simple
user.name=Wilfredo Perez
[email protected]
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
core.hidedotfiles=dotGitOnly
remote.origin.url=https://bitbucket.org/XXXXX
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master

At the end of the day, according to the docs, I do not know if they go in false or input. Can someone guide me?

    
asked by Wilfredo 12.04.2016 в 19:12
source

1 answer

7

What you are looking at are the values of the local configuration, not global. The git configuration can be defined at several points, but the most specific takes precedence. If you want to see the global values you have to include the flag

git config --list --global

But the configuration of the repository in which you are working has the value core.autocrlf=true and is the one that will be used to work in this repository.

On the other hand, the recommended value if you are working in Windows is to leave autocrlf in true . What this does is that when you checkout the repository the line changes will be converted to Windows format (CRLF) but only locally, when you make a commit the line changes will be converted back to the orginal format. That is to say if in the repository it was already saved as Windows stays like this, if it was Linux (LF) converts it.

In your specific case you have 2 options to change the configuration:

You remove the value of the configuration in the local repository in such a way that the global value is imposed:

git config --unset core.autocrlf

You change the local value you want, note that --global is not used here, you just have to run it from the repository folder

git config core.autocrlf false
    
answered by 12.04.2016 / 19:23
source