我要发布这个,然后发布答案,因为它让我发疯,直到我弄清楚这个问题。
通过 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
没有帮助。