当前位置: 首页 > news >正文

Git Large File Storage (LFS) 的安装与使用

Git Large File Storage [LFS] 的安装与使用

  • 1. An open source Git extension for versioning large files
  • 2. Installing on Linux using packagecloud
  • 3. Getting Started
  • 4. `Error: Failed to call git rev-parse --git-dir: exit status 128`
  • References

1. An open source Git extension for versioning large files

https://git-lfs.com/

Git Large File Storage (LFS) replaces large files such as audio samples, videos, datasets, and graphics with text pointers inside Git, while storing the file contents on a remote server like GitHub.com or GitHub Enterprise.

在这里插入图片描述

https://github.com/git-lfs/git-lfs

Git LFS is a command line extension and specification for managing large files with Git.

The client is written in Go, with pre-compiled binaries available for Mac, Windows, Linux, and FreeBSD.

2. Installing on Linux using packagecloud

https://github.com/git-lfs/git-lfs/blob/main/INSTALLING.md

packagecloud hosts git-lfs packages for popular Linux distributions with apt/deb and yum/rpm based package-managers.

apt/deb: sudo apt-get install git-lfs

(base) yongqiang@yongqiang:~$ sudo apt-get install git-lfs
...
Unpacking git-lfs (2.9.2-1) ...
Setting up git-lfs (2.9.2-1) ...
Processing triggers for man-db (2.9.1-1) ...
(base) yongqiang@yongqiang:~$(base) yongqiang@yongqiang:~$ git-lfs --version
git-lfs/2.9.2 (GitHub; linux amd64; go 1.13.5)
(base) yongqiang@yongqiang:~$

3. Getting Started

(1) Download and install the Git command line extension. Once downloaded and installed, set up Git LFS for your user account by running:

git lfs install

You only need to run this once per user account.

(2) In each Git repository where you want to use Git LFS, select the file types you’d like Git LFS to manage (or directly edit your .gitattributes). You can configure additional file extensions at anytime.

git lfs track "*.psd"

Now make sure .gitattributes is tracked:

git add .gitattributes

Note that defining the file types Git LFS should track will not, by itself, convert any pre-existing files to Git LFS, such as files on other branches or in your prior commit history. To do that, use the git lfs migrate command, which has a range of options designed to suit various potential use cases.

(3) There is no step three. Just commit and push to GitHub as you normally would; for instance, if your current branch is named main:

git add file.psd
git commit -m "Add design file"
git push origin main

4. Error: Failed to call git rev-parse --git-dir: exit status 128

(base) yongqiang@yongqiang:~/whisper_work$ git-lfs --version
git-lfs/2.9.2 (GitHub; linux amd64; go 1.13.5)
(base) yongqiang@yongqiang:~/whisper_work$
(base) yongqiang@yongqiang:~/whisper_work$ git lfs install
Error: Failed to call git rev-parse --git-dir: exit status 128
Git LFS initialized.
(base) yongqiang@yongqiang:~/whisper_work$

https://github.com/git-lfs/git-lfs/issues/3964

  1. git lfs install --skip-repo
(base) yongqiang@yongqiang:~/whisper_work$ git lfs install --skip-repo
Git LFS initialized.
(base) yongqiang@yongqiang:~/whisper_work$
  1. 更新 Git LFS v2.10.0 以上的版本

References

[1] Yongqiang Cheng, https://yongqiang.blog.csdn.net/
[2] Git Large File Storage, https://git-lfs.com/

http://www.lryc.cn/news/358539.html

相关文章:

  • 使用国产工作流引擎,有那些好处?
  • 掌握 Go 语言:使用 net/http/httptrace 包优化HTTP请求
  • 探秘Flask中的表单数据处理
  • java —— 包装类及拆箱、装箱
  • 运算符重载(下)
  • 杭州服务器的性能如何?
  • linux centos nfs挂载两台服务器挂载统一磁盘目录权限问题
  • STL:string
  • 贷款借钱平台 小额贷款系统开发小额贷款源码 贷款平台开发搭建
  • 软设之算法的效率
  • 前端开发(2)--HTML常用的标签
  • 任何图≌自己这一几何最起码常识推翻直线公理让R外标准实数一下子浮出水面
  • js 纯前端实现数组分页、列表模糊查询、将数组转成formdata格式传给接口
  • elasticsearch有什么用
  • iOS自动连接已知Wi-Fi功能的实现
  • 编辑任何场景! 3DitScene:通过语言引导的解耦 Gaussian Splatting开源来袭!
  • CCIG 2024:合合信息文档解析技术突破与应用前景
  • 关于TeamSpeak3-网易音乐机器人的基础使用方法(胎教级教程)
  • 看广告赚金币提现小游戏app开发源码
  • 【vue】@、@/、../和./的区别
  • imx93 uboot 构建
  • 视觉SLAM十四讲:从理论到实践(Chapter7:视觉里程计1)
  • c++指针的*
  • 快团团大团长帮卖团长团长如何获得物流查询码?
  • MySQL(二)基本SQL语句以及基本函数应用
  • fyne apptab布局
  • Python实现定时任务的方式
  • 微信小程序-网络数据请求(配置request合法域名)
  • 栈和队列题目练习
  • 【排列问题】