Press "Enter" to skip to content

GitHub Desktop上传代码报错

具体报错信息如下:

The remote disconnected. Check your Internet connection and try again.

解决方案一:提高git上传缓冲区的文件大小http.postBuffer(以下设置为2G,通常不用),以及上传超时的时间lfs.activitytimeout(如缓冲区大小更改后无效再尝试)

git config --global http.postBuffer 2104944640 
git config --global lfs.activitytimeout 120

解决方案二:在了解方案一之前,我尝试使用.gitignore排除以下文件及目录,也可上传成功且不影响项目正常开发。

.DS_Store
/bin
/obj

One Comment

  1. sfrost
    sfrost 11/30/2024

    虽然我使用方案一能成功上传代码(包括bin/obj),但我还是听从chatgpt意见,将缓冲区大小还原、且github代码也进行了回滚操作revert changes。

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注