git large file push 问题 lfs tool 使用

git上传文件过大会出现以下问题:

remote: Resolving deltas: 100% (13/13), completed with 1 local object.
remote: warning: File reference/IEEE slam 2020/bulk-download (9).zip is 63.66 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: 1701297b460ffbac13931d2138066183f42e1597d502b20d31df2fd5819f569e
remote: error: See http://git.io/iEPt8g for more information.

使用网上教程的时候,由于不熟悉,容易踩坑,之前一直尝试没成功过,今天终于成功了,记录一下。

正确的步骤是:

git lfs install
git lfs track "your_large_file"
git add .gitattributes
git add your_large_file
git commit -m "Add large file"
git push origin master

注意事项

1.大文件路径中的特殊符号处理

首先,因为大文件中含有括号和空格,出现了以下错误,导致第一次尝试lfs大文件工具使用失败,因此解决这个问题非常关键。

bash: syntax error near unexpected token `('

所以在使用git lfs track这个指令的时候,一定要带""双引号,否则极易出错,而且还不知道原因在哪。

2.gitattributes添加之后,使用git add能利用tab键自动查找到large file,否则证明添加大文件路径时出错

在使用git lfs track "your_large_file"指令的时候,要带路径!!带文件路径!!不能只是文件名,否则会出错!!

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

晚餐男孩

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值