我要张贴这个,然后发布答案,因为它让我疯狂,直到我弄清楚这个问题。
通过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
我知道它与git在克隆上更改空格或行结尾有关,然后当它尝试检出特定提交时,它会失败,因为行结尾现在已经改变了。 git config core.autocrlf input
没有帮助。
答案 0 :(得分:0)
在~/.gitattributes
我有这一行:
* text=auto
删除它和确保core.autocrl
f设置为“input”或“false”将解决此问题。
FWIW,我在Mac上,我和Homebrew有类似的问题,我希望能解决这个问题。