美文网首页
Git Lfs 操作记录

Git Lfs 操作记录

作者: 逆水寒Stephen | 来源:发表于2024-01-04 16:44 被阅读0次

    安装Lfs:

    官方地址:https://github.com/git-lfs/git-lfs#installing

    仓库下操作:

    • 第一步,仓库配置lfs:
    git lfs install
    
    • 第二步,追踪大文件:
    //通配符追踪到某类型文件
    git lfs track "*.aar"
    //或者追踪到某个具体文件
    git lfs track "2.png"
    //可以取消追踪文件
    git lfs untrack "1.png"
    
    • 第三步,提交到仓库:
    git add .gitattributes
    git commit -m "add .gitattributes"
    

    上面第二步设置的追踪逻辑是需要设置最终文件再add文件才能生效,即git add file 之后文件才可能被追踪,也才能查看得到,通过 git lfs ls-files 可以随时查看正在被 LFS 追踪的文件:

    git lfs ls-files
    9a3c7dae41 * 1.png
    d61cf5835a * 2.png
    158213f90f * 3.svg
    

    新文件使用 LFS 管理

    git add biggerthanbigger.zip
    git commit -m "add bigger than bigger zip file"
    

    相关文章

      网友评论

          本文标题:Git Lfs 操作记录

          本文链接:https://www.haomeiwen.com/subject/cvlbndtx.html