Table of contents
Common commands
Install
yum install git-lfs
Download the file pointer at the same time for the first time:
git lfs clone
The first simultaneous download simultaneously downloads the file itself:
git lfs clone
Pull the file itself with the following command that has been downloaded
git lfs pull
Git LFS Other Commands
git lfs ls-files displays a list of files currently tracked by lfs
git lfs track view existing file tracking mode
git lfs untrack "\*xx.a" cancels the tracking of a file by git lfs
use
:::block-1
cd to the directory where the git repository is located
git lfs track "xxx", tell lfs which files need to be processed
At this point, the .gitattributes file will appear in the directory, which contains the tracking information of lfs
:::
Note: You need to add .gitattributes to version control
Original link: https://blog.csdn.net/dddgggd/article/details/128859423
principle
Large files in a project can take up space.
git lfs (large file storage) replaces large files with small pointers. When these large files are really needed, they will be downloaded from the local or remote lfs cache.
git lfs has a local lfs cache and a remote lfs storage warehouse.
When you add a file, git lfs replaces its contents with a pointer and stores the file locally in the git lfs cache
When you push a file, in addition to ordinary files will be pushed normally, these lfs files will also be transferred from the local lfs cache to the remote lfs storage warehouse
- When you checkout a commit that contains an lfs pointer, the pointer file will be replaced by the backup in the local lfs cache, or the backup in the lfs repository
Of course, the pointer is also a file, the content of which is as follows
version https://git-lfs.github.com/spec/v1
oid sha256:5b62e134d2478ae0bbded57f6be8f048d8d916cb876f0656a8a6d1363716d999
size 285
The first line inside is a pointer file specification URL, the second line is the object id, and the third line is how many bytes the file has.
Instructions
- download and install
yum install git-lfs
If not, go to https://pkgs.org to search for download and install:
https://pkgs.org/search/?q=git-lfs
Warehouse configuration file, add this address:
vim lcxrdma.repo
Install
dnf install git-lfs
use:
Download the file pointer at the same time for the first time:
git lfs clone
The first simultaneous download simultaneously downloads the file itself:
git lfs clone
Pull the file itself with the following command that has been downloaded
git lfs pull
use
:::block-1
cd to the directory where the git repository is located
git lfs track "xxx", tell lfs which files need to be processed
At this point, the .gitattributes file will appear in the directory, which contains the tracking information of lfs
:::
Note: You need to add .gitattributes to version control
Original link: https://blog.csdn.net/dddgggd/article/details/128859423
Git LFS Other Commands
git lfs ls-files displays a list of files currently tracked by lfs
git lfs track view existing file tracking mode
git lfs untrack "\*xx.a" cancels the tracking of a file by git lfs
Error record
certificate signed by unknown authority
[root@localhost ceastor-pxe]# git lfs pull
batch response: Post "https://code.cestc.cn/storage/ceastor/engine/ceastor-pxe.git/info/lfs/objects/batch": x509: certificate signed by unknown authority
Failed to fetch some objects from 'https://code.cestc.cn/storage/ceastor/engine/ceastor-pxe.git/info/lfs'
deal with:
git config http.sslverify false
git config --global http.sslVerify false