viernes, 7 de febrero de 2025

git lfs what a great option

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.

 

a diagram showing how Git LFS works

 

To install it.

Run the script provided

curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
[sudo] password for alejandro:
Detected operating system as Ubuntu/noble.
Checking for curl...
Detected curl...
Checking for gpg...
Detected gpg...
Detected apt version as 2.7.14
Running apt-get update... done.
Installing apt-transport-https... done.
Installing /etc/apt/sources.list.d/github_git-lfs.list...done.
Importing packagecloud gpg key... Packagecloud gpg key imported to /etc/apt/keyrings/github_git-lfs-archive-keyring.gpg
done.
Running apt-get update... done.

The repository is setup! You can now install packages. 

 

Install git-lfs

$ sudo apt-get install git-lfs
[sudo] password for alejandro:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libllvm17t64 python3-netifaces
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
  git-lfs
0 upgraded, 1 newly installed, 0 to remove and 26 not upgraded.
Need to get 8,488 kB of archives.
After this operation, 18.1 MB of additional disk space will be used.
Get:1 https://packagecloud.io/github/git-lfs/ubuntu noble/main amd64 git-lfs amd64 3.6.1 [8,488 kB]
Fetched 8,488 kB in 2s (4,515 kB/s)
Selecting previously unselected package git-lfs.
(Reading database ... 250641 files and directories currently installed.)
Preparing to unpack .../git-lfs_3.6.1_amd64.deb ...
Unpacking git-lfs (3.6.1) ...
Setting up git-lfs (3.6.1) ...
Git LFS initialized.
Processing triggers for man-db (2.12.0-4build2) ...

 

 Run git lfs on the repository

$ git lfs install
Updated Git hooks.
Git LFS initialized. 


 Run git lfs to track csv files

$ git lfs track "*.csv"
Tracking "*.csv"

$ git add .gitattributes


Run git add and push the commit

$ git add .

$ git commit -m "Git lfs testing with files .csv"

$ git push origin main 


List all lfs files tracked

$ git lfs ls-files --all

No hay comentarios:

Publicar un comentario