Git 提交 fatal: the remote end hung up unexpectedly

26 阅读1分钟

问题

git push 时遇报错

image.png

解决方式

经排查是因为本地提交的文件中包含了.DS_Store文件夹,递归删除工程中此文件夹即可

清理现有文件

find . -name '*.DS_Store' -type f -delete

全局忽略

git config --global core.ignoreCase 1
echo '.DS_Store' >> ~/.gitignore_global

VSCODE配置

"files.exclude": { "**/.DS_Store": true }