CentOS7 安装 Git LFS

Git 大文件存储 (LFS) 使用 Git 内部的文本指针替换音频样本、视频、数据集和图形等大文件,同时将文件内容存储在 GitHub.com 或 GitHub Enterprise 等远程服务器上。

1
$ curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.rpm.sh | sudo bash

执行这个命令将会自动为您系统添加YUM源,具体的安装过程如下所示:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Detected operating system as centos/7.
Checking for curl...
Detected curl...
Downloading repository file: https://packagecloud.io/install/repositories/github/git-lfs/config_file.repo?os=centos&dist=7&source=script
done.
Installing pygpgme to verify GPG signatures...
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.huaweicloud.com
 * extras: mirrors.huaweicloud.com
 * updates: mirrors.huaweicloud.com
github_git-lfs-source/signature                                                                                                                                                                                                                |  833 B  00:00:00     
github_git-lfs-source/signature                                                                                                                                                                                                                | 1.0 kB  00:00:00 !!! 
Package pygpgme-0.3-9.el7.x86_64 already installed and latest version
Nothing to do
Installing yum-utils...
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.huaweicloud.com
 * extras: mirrors.huaweicloud.com
 * updates: mirrors.huaweicloud.com
Package yum-utils-1.1.31-54.el7_8.noarch already installed and latest version
Nothing to do
Generating yum cache for github_git-lfs...
Generating yum cache for github_git-lfs-source...

The repository is setup! You can now install packages.

接下来就可以使用 YUM 命令进行安装 GIT LFS啦,可以以下命令进行安装

1
$ yum install -y git-lfs

执行以下命令,拉取远程仓库大文件

1
$ git lfs pull
comments powered by Disqus