我遇到了git
and的问题Windows
。事实证明,工作团队正在努力,我linux
发现自己和.Windows
commit
Windows
Linux
搜索 SO 英语,它说只是做:
git config --global core.autocrlf false
应该更改设置,但由于某种原因,当我这样做时,它会让我处于true
,换句话说,我看不到任何效果。完整代码:
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
归根结底,根据文档,我不知道它们是错误的还是输入的。有人可以指导我吗?
你看到的是本地配置的值,不是全局的。git 配置可以在不同点定义,但最具体的优先。如果要查看全局值,则必须包含标志
但是您正在处理的存储库的配置具有价值
core.autocrlf=true
,并且将用于在此存储库上工作。另一方面,如果您在 Windows 上工作,建议的值是
autocrlf
离开true
. 这样做的目的是,当您签出存储库时,换行符将被转换为 Windows (CRLF) 格式,但仅在本地,当您提交时,换行符将被转换回原始格式。换句话说,如果它已经在存储库中保存为 Windows,它会保持这种状态,如果它是 Linux (LF),它会转换它。在您的特定情况下,您有 2 个选项来更改配置:
您以强制执行全局值的方式删除本地存储库中的设置值:
您将本地值更改为您想要的值,注意这里没有使用它
--global
,您只需从存储库文件夹中运行它