当前位置: 首页 > news >正文

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
http://www.dtcms.com/a/271242.html

相关文章:

  • 数学建模:非线性规划:二次规划问题
  • 项目管理进阶——解读智能制造项目PMO规划与项目管理方案【附全文阅读】
  • 软件测试报告第三方是什么?软件测试报告都包含啥?
  • 理解死锁:场景、实例与预防策略
  • JavaScript数组方法——梳理和考点
  • 20-C#构造函数--虚方法
  • 深度学习11(调参设参+批标准化)
  • tomcat设置预防host头攻击
  • 使用octomap将pcd点云地图转化为八叉树地图和占据栅格地图
  • MCP快速入门—快速构建自己的服务器
  • 龙虎榜——20250709
  • OpenAI 推出其 AI 代理框架的四项关键更新
  • Python数据分析案例|从模拟数据到可视化:零售门店客流量差异分析全流程
  • 拼多多正在错失即时零售?
  • C++智能指针与Qt内存管理详解
  • RESTful接口设计规范详解
  • SAP采购管理系统替代选谁?8Manage SRM全面优势测评与深度对比
  • 码云创建分支
  • 网络请求与现实生活:用办理业务类比理解HTTP通信
  • ubuntu环境下调试 RT-Thread
  • 降AI工具有哪些推荐?降AI率网站的选择与使用指南
  • 人工智能-基础篇-27-模型上下文协议--MCP到底怎么理解?对比HTTP的区别?
  • SDR(软件定义无线电)与软件定义声学系统详解
  • ECR仓库CloudFormation模板完整指南
  • 第1章 Excel界面环境与基础操作指南
  • 精准医疗,AR 锚定球囊扩张导管为健康护航​
  • 微信小程序控制空调之微信小程序篇
  • 机器学习(西瓜书) 第四章 决策树
  • 【论文阅读】AdaReasoner: Adaptive Reasoning Enables More Flexible Thinking
  • 量化数据接口,level2历史数据,level2实时数据,逐笔成交,逐笔委托,10档行情接口