I am running into a problem with git
and Windows
. It turns out that the work team is working on linux
and I find myself with Windows
, so when I do a commit
line breaks that I take into account are the Windows
ones and therefore the people who make the publications tell me that I must change this to the Linux
.
Searching SO English, it says to just do:
git config --global core.autocrlf false
the setting should be changed, but for some reason when I do it it leaves me at true
, in other words I see no 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 don't know if they go to false or input. Can someone guide me?
What you are seeing are the values of the local configuration, not global. The git configuration can be defined at various points, but the most specific takes precedence. If you want to see the global values you have to include the flag
But the configuration of the repository you are working on has the value
core.autocrlf=true
and is the one that will be used to work on this repository.On the other hand, the recommended value if you are working on Windows is to
autocrlf
leavetrue
. What this does is that when you checkout the repository the line feeds will be converted to Windows (CRLF) format but only locally, when you commit the line feeds will be converted back to the original format. In other words, if it was already saved as Windows in the repository, it stays that way, if it was Linux (LF), it converts it.In your specific case you have 2 options to change the configuration:
You remove the setting value in the local repository in such a way that the global value is enforced:
You change the local value to the one you want, notice that it is not used here
--global
, you just have to run it from the repository folder