git lfs setpu(4)



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'

优质内容筛选与推荐>>
1、C# 时间操作类
2、【ASP.NET Core】运行原理(2):启动WebHost
3、JavaBean内省的简单操作,剖析JavaBean属性设置的原理。。
4、mysql+mycat搭建高可用集群 负载均衡+主备复制+读写分离
5、Something about SeekingJob---Resume简历


长按二维码向我转账

受苹果公司新规定影响,微信 iOS 版的赞赏功能被关闭,可通过二维码转账支持公众号。

    阅读
    好看
    已推荐到看一看
    你的朋友可以在“发现”-“看一看”看到你认为好看的文章。
    已取消,“好看”想法已同步删除
    已推荐到看一看 和朋友分享想法
    最多200字,当前共 发送

    已发送

    朋友将在看一看看到

    确定
    分享你的想法...
    取消

    分享想法到看一看

    确定
    最多200字,当前共

    发送中

    网络异常,请稍后重试

    微信扫一扫
    关注该公众号