git上传大文件启用LFS git报错 the remote end hung up unexpectedly
最近由于某git平台要下线所以迁移工程,但是之前的平台支持200MB以上的文件,迁移到其他的平台均不支持,于是经过一番查找,要开启LFS功能,把文件进行切割压缩之后才能上传
1.国内git平台
- gitee(限制5人协作,限制组织数的创建)
- gitcode
- 阿里云效codeup
- 腾讯工蜂
2.git LFS
大文件存储
git lfs install
git lfs track "*.rar"
git add .
git commit -m"启用git lfs大文件追踪"
git push origin
已经存储在文件仓库的大文件
git rm --cached -r .
git lfs install
git lfs track "*.rar"
#推送大文件到 LFS 服务器
#对于之前已经提交的大文件,你需要使用 git lfs migrate 命令将它们迁移到 LFS
git lfs migrate import --include="*.rar" --everything
git add .
# 替换url
git remote set-url origin git@codeup.aliyun.com:682/easy/home.git
# 推送当前所有的分支和 tags
git push origin --tags && git push origin --all
3.如果提交不成功需要设置git仓库的缓存 git报错 the remote end hung up unexpectedly 的解决办法
修改git缓存为1g
git config --global http.postBuffer 1048576000
# 1048576000即1G,如果不行,还可以设置得更大一些。
git config --global http.postBuffer 157286400
git config --global http.postBuffer 524288000
git config --global http.postBuffer 2048576000
4.git指令
# git仓库之前存在的大文件
git rm --cached -r .
git lfs install
git lfs track "*.mp4"
git add -A
git commit -m "Track *.mp4 files with Git LFS"
# 推送大文件到 LFS 服务器
# 对于之前已经提交的大文件,你需要使用 git lfs migrate 命令将它们迁移到 LFS
git lfs migrate import --include="*.mp4" --everything
git add .gitattributes
git commit -m "Migrate *.mp4 files to Git LFS"
git push origin main # 替换 `main` 为你的分支名
git remote set-url origin git@codeup.aliyun.com:682194ca/easy/home.git
git push origin --tags && git push origin --all
- 备注指令文件
git remote set-url origin git@codeup.aliyun.com:682194/easy/home.git
git push origin --tags && git push origin --all
大文件存储
git lfs install
git lfs track "*.rar"
git add .
git commit -m"启用git lfs大文件追踪"
git push origingit仓库之前存在的大文件
git rm --cached -r .git lfs track "*.mp4"
git add -A
git commit -m "Track *.mp4 files with Git LFS"推送大文件到 LFS 服务器
对于之前已经提交的大文件,你需要使用 git lfs migrate 命令将它们迁移到 LFS
git lfs migrate import --include="*.mp4" --everything
git add .gitattributes
git commit -m "Migrate *.mp4 files to Git LFS"
git push origin main # 替换 `main` 为你的分支名修改git缓存为1g
git config --global http.postBuffer 1048576000
git config --global http.postBuffer 157286400
048576000即1G,如果不行,还可以设置得更大一些。如果还是没能解决,可尝试为git添加compression配置选项后重试:
git config --global core.compression -1git报错 the remote end hung up unexpectedly 的解决办法
调整代码推送的大小
https://blog.csdn.net/m0_52096593/article/details/129385459
在项目的.git目录下打开config配置文件,在最底下增加如下的配置:
[http]
postBuffer = 524288000157286400
git config --global http.postBuffer 157286400
git config --global http.postBuffer 524288000
git config --global http.postBuffer 2048576000