• 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'

  • 相关阅读:
    函数
    大对象数据LOB
    【缓冲流、转换流、序列化流】
    【字节流、字符流】
    【File类、递归】
    【缓冲流、转换流、序列化流】
    vee-validate的使用
    微信小程序第三方授权登录
    新电脑搭建vue项目步凑
    移动端300ms延迟问题和点击穿透问题
  • 原文地址:https://www.cnblogs.com/lianghong881018/p/10832965.html
Copyright © 2020-2023  润新知