我要发布这个,然后发布答案,因为它让我发疯,直到我弄清楚问题 .
通过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
没有帮助 .
1 回答
在
~/.gitattributes
我有这条线:删除它并确保
core.autocrl
f设置为"input"或"false"将解决此问题 .FWIW,我在Mac上,我和Homebrew有类似的问题,我希望能解决这个问题 .