douzhuo8312 2013-10-10 20:12
浏览 87
已采纳

由于gitattributes,通过composer安装symfony / symfony时出错

I'm going to post this, then post the answer since it drove me crazy until I figured out the issue.

When installing symfony/symfony via composer, the process was repeatedly aborting due to this error:

[RuntimeException]                                                                                                                        
  Failed to execute git checkout 'fc0a09a2052e9275c16b5ab7af426935fe432f39' && git reset --hard 'fc0a09a2052e9275c16b5ab7af426935fe432f39'  

  error: Your local changes to the following files would be overwritten by checkout:                                                        
    src/Symfony/Component/Validator/Resources/translations/validators.bg.xlf                                                                 
  Please, commit your changes or stash them before you can switch branches.                                                                 
  Aborting   

I know it has something to do with git changing whitespace or line-endings on clone, then when it tries to checkout the specific commit, it fails since the line-endings have now been changed. git config core.autocrlf input didn't help.

  • 写回答

1条回答 默认 最新

  • doubinduo3364 2013-10-10 20:19
    关注

    In ~/.gitattributes I had this line:

    * text=auto
    

    Removing it and ensuring core.autocrlf is set to "input" or "false" will fix this issue.

    FWIW, I'm on a Mac and I've had similar issues with Homebrew that I'm hoping this fixes.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 宇视监控服务器无法登录
  • ¥15 PADS Logic 原理图
  • ¥15 PADS Logic 图标
  • ¥15 电脑和power bi环境都是英文如何将日期层次结构转换成英文
  • ¥15 DruidDataSource一直closing
  • ¥20 气象站点数据求取中~
  • ¥15 如何获取APP内弹出的网址链接
  • ¥15 wifi 图标不见了 不知道怎么办 上不了网 变成小地球了
  • ¥50 STM32单片机传感器读取错误
  • ¥50 power BI 从Mysql服务器导入数据,但连接进去后显示表无数据