Git-lfs use notes


Title: git-lfs notes
comments: true
categories: notes
tags:

  • git lfs
  • tools
  • github
    abbrlink: 68597cc5
    date: 2018-07-04 12:47:40

Foreword

I always wanted to find a file that can store a large file and it can be operated like git.
starts preparing for self-built svn to meet demand
After seeing some of github's documentation, I saw the git lfs (Git Large File Storage) feature.
Just understand it. By the way, take note of this note.
Common git repository sites offer git lfs storage such as github
Any commands in the notes have been executed in ubuntu

Actual combat

Install git lfs

Git lfs supports direct binary installation, various package management tool installations (apt, yum, pacman, etc.)

#install git lfs
 sudo apt install git-lfs
   # Initialize git lfs
 sudo git lfs install 
Configuring lfs managed files

Initialize the lfs configuration file

Git lfs track "<directory>/*"

Executing the above command will generate .gitattributes in the root of the project.
The content is roughly as follows

<directory>/* filter=lfs diff=lfs merge=lfs -text
Add lfs .gitattributes to the repository
sudo git add .gitattributes 
sudo commit -m "init  git lfs config"
Add and upload large files

Copy large files to <directory>

Sudo git add <directory>/xxx
sudo git commit -m "update xxx"
sudo git push 

File updates based on git lfs management will be displayed as

Git LFS: (1 of 1 files) 9.18 KB / 9.18 KB                                                                                                                      
In the object count: 10, completed.
。。。。。。。。
Git lfs uninstall
  • Uninstall git lfs
sudo apt --purge remove git-lfs
  • Delete lfs related filter
#View git global configuration
git config -l 
 # Delete and lfs related configuration
 ## View lfs related configuration
git config -l|grep lfs
 ## 
git config --global --unset filter.lfs.clean
git config --global --unset filter.lfs.smudge
git config --global --unset filter.lfs.process
git config --global --unset filter.lfs.required
git config --global --unset filter.lfs.required
 # Delete lfs warehouse address Delete as needed
git config --global --unset lfs.https://github.com/xuxianyu/blog.git/info/lfs.access

to sum up

The function of git is getting more and more hanged. Now I can manage large files well.
git is just a pointer to a large file. It is not responsible for storage. It still keeps git efficient and easy to use. But there is a batch that can manage large files.

Intelligent Recommendation

Domestic free git warehouse and git lfs large file storage solution (LFS) use

Git LFS, the full name Git Large File Storage, is a solution that Github took the lead in launching in 2015. There are currently two free warehouses in China: Tencent's "Tencent Worker Bee" ...

Configure git and git-lfs

Set user information Set Git user name and email: (if this is the first time) 1. Configure username 2. Configure Email 3. Generate the key Enter 3 consecutively. If no password is required. Finally, t...

Git LFS error "git LFS is not installed"

Use git-lfs for the first time, install it, execute after installationgit lfs pull, Error: The translation of the literal means that the LFS is not installed, so I go to install LFS and still report a...

How to use GitHub LFS to let git handle large files

1. Installation installationGit Enter the official websiteGitHub LFSDownload and installGitHub LFS 2. Enter Github's local repository directory to initialize LFS 3. Manage large files with git lfs Use...

Use GIT-LFS to upload large files (over 50M

Use GIT-LFS to upload large files (over 50M) Recently, when using git, I encountered the problem that files exceeding 50M were too large to be uploaded, and git-lfs was used to solve it. git-lfs downl...

More Recommendation

linux install git lfs

welcome to my blog 1. View the CPU architecturelscpu 2. Download the corresponding version of the linux installation package,download link Just download the latest version, the latest version I downlo...

Git LFS learning application

The company's computer controls, you can't log in to any account, and there is a size limit for email reception, so there are many books and materials that you have collected, and notes that are diffi...

Git lfs tutorial

Brief description If someone else used the lfs strategy when creating a warehouse, how should you clone this warehouse? The following is a detailed tutorial. Note: lfs is Large File Storage. Using the...

Git LFS operation documentation

1. Background Colleagues in the development team found that there are large files in the git project, and the local git cache file is relatively large, which makes it impossible to clone. To solve thi...

install git lfs on ubuntu

Reference page...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top