简体   繁体   English

由于gitattributes,通过作曲家安装symfony / symfony时出错

[英]error installing symfony/symfony via composer due to gitattributes

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: 通过composer安装symfony / symfony时,由于该错误,该进程反复中止:

[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更改克隆上的空格或行尾有关,然后当它尝试签出特定的提交时,由于行尾现在已更改,因此它失败。 git config core.autocrlf input didn't help. git config core.autocrlf input没有帮助。

In ~/.gitattributes I had this line: ~/.gitattributes我有这行:

* text=auto

Removing it and ensuring core.autocrl f is set to "input" or "false" will fix this issue. 删除它确保将core.autocrl f设置为“ input”或“ false”将解决此问题。

FWIW, I'm on a Mac and I've had similar issues with Homebrew that I'm hoping this fixes. FWIW,我在Mac上,并且我希望Homebrew遇到类似的问题,希望能解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM