【git】Ubuntu操作系统上安装Git LFS

一、场景

    简单来讲、这玩意就是下载大文件用的

 

二、官网

https://www.atlassian.com/git/tutorials/git-lfs#what-is-git-lfs

 

三、安装

curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
sudo apt-get install git-lfs
git lfs install

 

四、用法

使用git lfs --help

EXAMPLES
       To get started with Git LFS, the following commands can be used.

        1. Setup Git LFS on your system. You only have to do this once per
           user account:

               git lfs install

        2. Choose the type of files you want to track, for examples all ISO
           images, with git-lfs-track(1):

               git lfs track "*.iso"

        3. The above stores this information in gitattributes(5) files, so
           that file needs to be added to the repository:

               git add .gitattributes

        4. Commit, push and work with the files normally:

               git add file.iso
               git commit -m "Add disk image"
               git push

常用命令

  • 显示当前被 lfs 追踪的文件列表
git lfs ls-files 
  • 查看现有的文件追踪模式
git lfs track 
  • 取消 git lfs 对某文件的追踪
git lfs untrack "\*xx.a" 
  • 查看当前 git lfs 版本
git lfs version 
  • 取消 LFS 的全局配置
git lfs uninstall

 

 

 

 

 

参考链接:

https://zhuanlan.zhihu.com/p/623818862

https://www.atlassian.com/git/tutorials/git-lfs#what-is-git-lfs

 

posted @ 2024-06-12 16:37  代码诠释的世界  阅读(289)  评论(0编辑  收藏  举报