美文网首页
Git 常见错误

Git 常见错误

作者: 哎呦喂_e2d5 | 来源:发表于2019-04-13 16:25 被阅读0次

fatal:refusing to merge unrelated histories

出现原因

使用git pull origin master命令时,提示此错误,是因为远程仓库中已经存在代码记录了,并且那部分代码没有和本地仓库进行关联

解决方法

git pull origin master --allow-unrelated-histories

warning: LF will be replaced by CRLF

出现原因

在各操作系统下,文本文件所使用的换行符是不一样的。

解决方法

1.AutoCRLF

#提交时转换为LF,检出时转换为CRLF
git config --global core.autocrlf true

#提交时转换为LF,检出时不转换
git config --global core.autocrlf input

#提交检出均不转换 (较合适的解决方法)
git config --global core.autocrlf false

2.SafeCRLF

#拒绝提交包含混合换行符的文件 (较合适的解决方法)
git config --global core.safecrlf true

#允许提交包含混合换行符的文件
git config --global core.safecrlf false

#提交包含混合换行符的文件时给出警告
git config --global core.safecrlf warn

相关文章

  • Git常见问题汇总

    12 git 常见错误解决方法 —————————————————————————————— 命令:git pul...

  • Git 常见错误

    如果commit已经提交, 版本出错的解决方法 通过哈希值回退版本 查看 Git commit 记录 取得之前的哈...

  • 常见git错误

    使用git在本地创建一个项目的过程 $ makdir ~/hello-world ...

  • git 常见错误

    错误 解决 不限制缓存 不限制网速 如果依旧clone失败,则首先浅层clone,然后更新远程库到本地

  • Git 常见错误

    fatal:refusing to merge unrelated histories 出现原因 使用git pu...

  • Git常见错误

    xcrun: error: invalid active developer path 使用终端克隆github的...

  • Git常见操作和常见错误!

    title: Git常见操作和常见错误!date: 2015-01-22 11:47:14categories: ...

  • Git常见错误整理

    错误1:Git: fatal: The remote end hung up unexpectedly解决办法: ...

  • git clone 常见错误

    1、错误: SSL certificate problem: self signed certificate 解决...

  • git常见错误整合

    1、fatal: cannot lock ref 'HEAD':解决方法重新创建Head echo ref: re...

网友评论

      本文标题:Git 常见错误

      本文链接:https://www.haomeiwen.com/subject/okcrwqtx.html