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. Devexpress WinForm GridControl实现单元格可编辑状态更改

    之前做项目的时候,需要实现这样的功能.在gridcontrol中,根据是否修改(checkbox)列的选中和未选中状态来联动另外一列的编辑状态.实现如下: private void gridView1 ...

  2. varnish CLI管理

    命令:varnishadm [-t timeout] [-S secret_file] [-T address:port] [-n name] [command [...]] ./varnishadm ...

  3. 【死磕Java并发】—–深入分析ThreadLocal

    ThreadLoacal是什么? ThreadLocal是啥?以前面试别人时就喜欢问这个,有些伙伴喜欢把它和线程同步机制混为一谈,事实上ThreadLocal与线程同步无关.ThreadLocal虽然 ...

  4. C# 7.0 语法

    C# 7.0的语法主要是优化了之前的写法,使得更加简洁方便.try catch when  这个使用场景很少,正常的开发无业务处理的时候不建议使用 . #region 2.字符串嵌入值 Console ...

  5. 如何演讲-摘录自TED

    一.首先,只传递一个主要思想  想法是个很复杂的东西,你要对你的内容做减法,突出重点,只关注一个主要思想,也就是你最富有热情的观点,利用机会好好的阐述它.你要给出案例,分享案例,生动阐述所以,找到一个 ...

  6. javaIO——StringReader & StringWriter

    上一篇概述篇说过,一个IO对象是指一个可以被关闭的数据源或者目标,那么StringReader和StringWriter就是一个字符串源和字符串目标. 1. StringtReader: 文档说:St ...

  7. 07 Redis存储Session

    django-redis-sessions 官方文档:https://pypi.org/project/django-redis-sessions/ dango-redis 官方文档:http://n ...

  8. Windows下解决系统端口被VM虚拟机占用问题

    一)问题背景 安装VM虚拟机后,经常会遇到启动其他程序时出现端口被占用的情况,其中以80端口被占用最为常见. 二)解决思路 解除或更改被占用端口号,但是更改端口号时,除非对系统的端口占用情况非常熟悉, ...

  9. Marketing Cloud demo环境和API使用方法说明

    version 1.0 作者:Wang Jerry 更多问题请联系我 demo 系统url:https:/jerry.hybris.com/sap/bc/ui5_ui5/ui2/ushell/shel ...

  10. beego学习笔记一:创建第一个beego Web项目 转

    前提工作 环境搭建,可以参考如下两篇教程:搭建Go语言环境1搭建Go语言环境2 安装beego beego 的安装是典型的 Go 安装包的形式: go get github.com/astaxie/b ...