使用bash在Windows XP计算机上运行git.我从SVN导出了我的项目,然后克隆了一个裸存储库.
然后我将导出粘贴到裸存储库目录中,并执行了:
git add -A
Run Code Online (Sandbox Code Playgroud)
然后我得到一条消息列表:
LF将由CRLF取代
这种转变的后果是什么?这是Visual Studio中的.NET解决方案.
使用Git,当使用该autocrlf = true
标志时,在更改行结尾时仍会发出警告.
我理解警告的内容,以及如何关闭行结束标志,但是如何关闭警告本身呢?
ENV:
我git commit
说,它说:
warning: LF will be replaced by CRLF.
Run Code Online (Sandbox Code Playgroud)
这个警告尾巴落后了吗?
我在Windows中编辑文件,行尾是CRLF
,就像这张图:
并且git将其更改LF
为承诺回购.
所以我认为正确的警告是:
warning: CRLF will be replaced by LF.
Run Code Online (Sandbox Code Playgroud) 我正在使用Windows.暂存文件时,我收到此错误.
Updating the Git index failed. A rescan will be automatically started to resynchronize git-gui.
后跟一个已从LF转换为CRLF的文件列表
在用Git使用跨平台阅读CRLF/LF问题之后,我或多或少地了解了发生了什么,我正在尝试确定哪种autocrlf设置最适合我,但我不明白为什么Git说更新索引失败.我的理解是它已经转换了EOF,所以它的问题是什么,为什么它告诉我更新索引失败了.我是否需要修复某些内容(除了选择适当的autocrlf设置)或者我可以继续
然后,我有两个选项继续和解锁索引,这些是什么意思,什么是最好的行动方案.
我目前正在尝试对(github)存储库的PR进行代码样式检查,并且我希望向提交者提供补丁,以便他们可以轻松地修复代码样式.为此,我正在拉下他们的PR,在它上面运行我们的解密脚本以修复任何样式错误,并且想要创建一个可以轻松应用的.patch文件.但是,它一直打破一些文件.
我这样做(git版本1.7.10.4 with core.autocrlf=input
,core.filemode=false
):
$ git checkout pr-branch
$ git log -1 (shows: commit dbb8d3f)
$ git status (nothing to commit, working directory clean)
$ <run the code styler script, which modifies some files>
$ git diff > ../style.patch (so the patch file lands outside the repo)
$ git reset --hard HEAD (to simulate the situation at the submitter's end)
$ git log -1 (shows: commit dbb8d3f)
$ git status (nothing to commit, working directory clean, so …
Run Code Online (Sandbox Code Playgroud) 我需要有关推送到 github 时出现错误的帮助
\n是什么导致了 Git 警告:LF will be returned by CRLF 错误?
\n如何修复 Git 警告:LF 将被 CRLF 替换
\n cd "C:\\Users\\JMLEE\\Desktop\\\xed\x8c\x8c\xec\x9d\xb4\xec\x8d\xac\\hw6"\n Git init\n git remote add origin https://github.com/rlaalswo1222/hw6.git\n git add .\n git status\n git commit -m "hw"\n git push origin master\n
Run Code Online (Sandbox Code Playgroud)\n我已按照 Windows 安装的建议将 git 配置为 autocrlf=true 。但是,当我运行flutter pub get
我的pubspeck.lock
文件时,不断获取 lf 作为行结尾。有没有办法配置 flutter 以使其尊重 clrf 设置?
# git status
On branch develop
Your branch is up to date with 'origin/develop'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: pubspec.lock
no changes added to commit (use "git add" and/or "git commit -a")
# git diff pubspec.lock
warning: LF will be …
Run Code Online (Sandbox Code Playgroud) 我正在使用GIT gui.我在文件夹中的几个文件中看到此错误.我有两个选择按钮 - 解锁索引并继续.我不明白按钮的作用.我看到其他SO帖子告诉我忽略警告,但他们没有提到如何在GUI中执行此操作.请告诉我应按哪个按钮以及为什么.谢谢.
这是错误消息示例 -
Updating the Git index failed. A rescan will be automatically started to resynchronize git-gui.
warning: LF will be replaced by CRLF in gen/com/click4tab/pustakalpha/BuildConfig.java.
The file will have its original line endings in your working directory.
(repeat above messages for other files)
Run Code Online (Sandbox Code Playgroud) 我已经阅读了这个答案中讨论的 Git 文档(LF 将被 git 中的 CRLF 取代 - 那是什么,它很重要吗?)但我不明白这对我的情况意味着什么。
我有 LF 文件,这些文件是由工具引入到我在 Windows 上的 git checkout 中的。当我尝试提交它们时,我收到了警告warning: LF will be replaced by CRLF in [file]
。
git config core.autocrlf
在这台机器上是真的。反正我答应了。Windows 上的行尾仍然是 LF。然后我在git config core.autocrlf
似乎没有设置的 Linux 机器上检查了该文件。我检查了那里的行尾,它们也是 LF。
所以我不明白的是,哪里说LF将被CRLF取代?这是否意味着,下次我对文件进行更改(由另一台机器上的某人提交)时,行尾将被转换?
另外 - Git 在其内部存储库中使用什么行结尾?
git ×9
line-endings ×2
windows ×2
dart ×1
flutter ×1
git-config ×1
git-gui ×1
github ×1
newline ×1
patch ×1