git - 当两个文件相同时,为什么 git 会向我显示此冲突?

标签 git

这是我在执行 $ git stash pop
时遇到的唯一冲突 它是文件的最后一行,并且最后一行都没有任何换行符。

Same line but still shows conflict

这是我对 git 不了解还是有 bug。
Git版本1.7.12

最佳答案

这似乎与'git: merge conflicts over newline at end of file一致',典型情况是将 core.autocrlf 设置为 false(我推荐),而不是“native”。
请注意, merge 不会忽略这些 eol 差异(请参阅“Is it possible for git-merge to ignore line-ending differences? ”)。

如果您希望自动完成这些 eol 转换,那么您可以考虑 .gitattributes 设置,如“Distributing git configuration with the code ”中所述。

关于git - 当两个文件相同时,为什么 git 会向我显示此冲突?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13118743/

相关文章:

git - 如何为每个 Git 分支设置不同的 user.name 和 user.email?

git - 从任何分支都无法访问的标记引用提交是否会丢失?

git - git stash/rebase 更改文件时间戳的避免/解决方法

git - .gitignore 用于 Joomla 组件

git - 从 GitHub 下载非常慢

java - 管理分支机构中的不同客户代码

macos - git分支切换需要半分钟?

git - 如何将 google-chrome 设置为 git 默认浏览器

git - 如何找到两个 git 提交之间的交集?

git - 如何从 Github 构建项目?说明不确定