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 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?