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 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置