reference:
https://packagecloud.io/github/git-lfs/install
https://zzz.buzz/zh/2016/04/19/the-guide-to-git-lfs/

root@hardware-dev:/home/anosi/work/git/git-lfs/git-lfs# curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
Detected operating system as Ubuntu/bionic.
Checking for curl...
Detected curl...
Checking for gpg...
Detected gpg...
Running apt-get update... done.
Installing apt-transport-https... done.
Installing /etc/apt/sources.list.d/github_git-lfs.list...done.
Importing packagecloud gpg key... done.
Running apt-get update... done.

The repository is setup! You can now install packages.

root@hardware-dev:/home/anosi/work/git/git-lfs/git-lfs# apt install git-lfs
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
libreadline7:i386
Use 'sudo apt autoremove' to remove it.
The following NEW packages will be installed:
git-lfs
0 upgraded, 1 newly installed, 0 to remove and 378 not upgraded.
Need to get 5,730 kB of archives.
After this operation, 13.9 MB of additional disk space will be used.
Get:1 https://packagecloud.io/github/git-lfs/ubuntu bionic/main amd64 git-lfs amd64 2.7.2 [5,730 kB]
Fetched 5,730 kB in 3s (1,729 kB/s)
Selecting previously unselected package git-lfs.
(Reading database ... 367353 files and directories currently installed.)
Preparing to unpack .../git-lfs_2.7.2_amd64.deb ...
Unpacking git-lfs (2.7.2) ...
Setting up git-lfs (2.7.2) ...
Git LFS initialized.
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...

root@hardware-dev:/home/anosi/work/git/tmp# git svn clone http://192.168.1.203/svn/software/iotx-am335x
root@hardware-dev:/home/anosi/work/git/tmp# cd iotx-am335x

root@hardware-dev:/home/anosi/work/git/tmp/iotx-am335x# git remote add origin https://github.com/13701761349/test_mc183.git

git lfs init
root@hardware-dev:/home/anosi/work/git/tmp/iotx-am335x# git lfs init
root@hardware-dev:/home/anosi/work/git/tmp/iotx-am335x# git lfs track "*.tar.gz"
Tracking "*.tar.gz"
root@hardware-dev:/home/anosi/work/git/tmp/iotx-am335x# git push -u origin master

Username for 'https://github.com': 13701761349
Password for 'https://13701761349@github.com':
Username for 'https://github.com': 13701761349
Password for 'https://13701761349@github.com':
Username for 'https://github.com': 13701761349
Password for 'https://13701761349@github.com':
Counting objects: 157335, done.
Delta compression using up to 16 threads.
Compressing objects: 100% (107479/107479), done.
Writing objects: 100% (157335/157335), 815.04 MiB | 908.00 KiB/s, done.
Total 157335 (delta 43582), reused 157335 (delta 43582)
remote: Resolving deltas: 100% (43582/43582), done.
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: 8e0f9c0b91a23ff9d5f7920454c1bc6a
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File TI-PROCESSOR-SDK-LINUX-AM335X-EVM-05.00.00.15/trunk/armbian-org-tar-rootfs/rootfs.tar.gz is 232.34 MB; this exceeds GitHub's file size limit of 100.00 MB
To https://github.com/13701761349/test_mc183.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/13701761349/test_mc183.git'
root@hardware-dev:/home/anosi/work/git/tmp/iotx-am335x# git filter-branch -f --index-filter 'git rm --cached --ignore-unmatch rootfs.tar.gz'
Cannot rewrite branches: You have unstaged changes.
root@hardware-dev:/home/anosi/work/git/tmp/iotx-am335x# git push -u origin master

GitHub对文件的大小有限制,问题在于,当移除了相关的文件之后,问题依然存在。

解决方法:
除了移除相关的文件,还要修改git的历史记录,移除相应的commit结点。

最简单的方法是使用以下命令:
git filter-branch -f --index-filter 'git rm --cached --ignore-unmatch YOUR-FILE'

此命令会将指定的文件从push过程中过滤掉。
请谨慎使用此命令,强烈建议在使用前先备份,以防止误操作。

git filter-branch -f --index-filter 'git rm --cached --ignore-unmatch rootfs.tar.gz'

git lfs setpu(4)的更多相关文章

  1. 如何使用 Git LFS 提交大文件?

    参考资料: An open source Git extension for versioning large files Git LFS的使用 如何使用 Git LFS 提交大文件? Git LFS ...

  2. 未安装git lfs导致git下载不完整,没有错误提示

    git clone命令没有报错. --recursive选项也加上了. cmake命令没有报错 make命令出错. 最后发现是因为没有安装git lfs,导致大文件下载不完整.最坑的是下载的时候也没有 ...

  3. GIT LFS 使用笔记

    一.背景 由于git上传文件大小受限,所以我们需要使用GIT LFS对大小超过一定上限的大文件进行处理. 二.安装 linux上安装参见 https://askubuntu.com/questions ...

  4. git lfs

    https://git-lfs.github.com/ 1.从这个网址下载git-lfs-windows-amd64-1.1.0.exe,运行这个安装包 2.然后打开git bash 输入git lf ...

  5. git lfs指令解决git status显示lib文件被修改,但是没有修改的问题。此时,git checkout没有用。

    $ git lfs migrate import --everything --include='*.LIB'https://github.com/git-lfs/git-lfs/issues/283 ...

  6. Git LFS的使用

    Git LFS的使用 Git LFS 是 Github 开发的一个 Git 的扩展,用于实现 Git 对大文件的支持 使用目的 在游戏开发过程中,设计资源占用了很大一部分空间. 像png,psd等文件 ...

  7. 更好的在 Git 项目中保存大文件(Git LFS 的使用)

    珠玉在前, 大家可以参考 Git LFS的使用 - 简书 为什么要用 Git LFS 原有的 Git 是文本层面的版本控制, 为代码这种小文件设计的, 保存大文件会导致 repo 非常臃肿, push ...

  8. apline无法向gitlab上传git lfs问题

    1 背景 在k8s中基于alpine做底层系统的容器进行git lfs push操作时,发现报错无法上传成功 Fatal error: Server error: http://git.ops.xxx ...

  9. Nexus OSS 3 搭建并配置使用 Docker & Git LFS 仓库

    转载自:https://cloud.tencent.com/developer/article/1010590 1.Nexus OSS 3 介绍 我们知道 Nexus 是一个强大的 Maven 仓库管 ...

随机推荐

  1. 【Python基础】12_Python中的容器类型公共方法

    1.Python中的内置函数 注:比较两个值,使用 <. >. == 2.切片 注:字典是一个无序集合,不能切片 3.运算符 字典中的in .not in  对字段操作时,只能判断字典的k ...

  2. .Net C# RSA签名和验签

    帮助类 using System; using System.Text; using System.IO; using System.Security.Cryptography; namespace ...

  3. 怎样限制第三方Cookie

    使用Cookie的 SameSite 属性. 1. SameSite=Strict; 这个模式下, 服务器将会完全禁止第三方Cookie, 在跨站点时, 任何情况下都不会发送Cookie, 也就是说, ...

  4. C# 委托 、事件、同步、异步知识点归纳

    一.委托 基本用法: 1.声明一个委托类型.委托就像是‘类'一样,声明了一种委托之后就可以创建多个具有此种特征的委托.(特征,指的是返回值.参数类型) public delegate void Som ...

  5. luogu题解 P3629 【[APIO2010]巡逻】树的直径变式

    题目链接: https://www.luogu.org/problemnew/show/P3629 分析 最近被众多dalao暴虐,这道题傻逼地调了两天才知道错哪 不过这题比较良心给你一个容易发现性质 ...

  6. java获取类的3种方式

    1.Class.forName("全类名"):将字节吗文件加载进内存,返回Class对象,多用于配指文件,将类名定义在配置文件中,便于利用java的反射机制生成类对象,加载类. / ...

  7. 基于SDP的提议/应答(offer/answer)模型简介

    1.引入 在松耦合会议中,会话参数完全由会议创建者来确定,参与者能做的仅仅是根据这些会话参数来加入会议(当然也可以选择不加入).这种情况下,主要要做的就是会话描述,在这里SDP本身就足够了. 但是在更 ...

  8. LeetCode 腾讯精选50题--合并K个排序链表

    今天的题目稍微有点复杂了,因为是K个有序链表的合并,看到这道题后的大体思路是这样的: 1.首先先做到两个链表的合并,链表的合并我想到的是用递归操作, 2.其次是多个链表的合并,所以在第一步实现的基础上 ...

  9. TensorFlow C++接口编译和使用

    部分内容from: Tensorflow C++ 从训练到部署(1):环境搭建 在之前的编译中,已经编译好了tensorflow_pkg相关的wheel.现在有一个需求,需要按照C++的代码进行模型加 ...

  10. Python 针对Excel操作

    1.python 读取Excel # -*- coding: utf-8 -*- import xlrd import os,sys reload(sys) sys.setdefaultencodin ...