lk/data/git/git-lfs.md
2025-02-12 17:46:59 +01:00

1.1 KiB

title tags
git-lfs
data
git

Git Large File Storage ('LFS') needs to change your ~/.gitconfig to check out those binary files:

cat ~/.gitconfig
git lfs install
cat ~/.gitconfig

Then track some filetypes with:

cd $git_repository
ext=ttf
git lfs track "*.$ext"

Or a directory with:

git lfs track "images/"

Track the changes to .gitattributes:

git status
git add .gitattributes
git commit -m "add $ext to lfs"

Bash Completion

If bash completion does not work, you'll have to add it:

git lfs completion bash |  sudo tee /usr/share/bash-completion/completions/git-lfs 

Trouble Shooting

You have some file "$FILE".png, which has some problem.

Check the filetype:

file "$FILE".png

This should say the type is 'image'. If it says the type is 'text', then this file is really just a reminder to git-lfs to check out that file.

Check git-lfs is expecting that file:

git lfs status
git lfs ls-files

...then try these commands, and check the filetype again:

git lfs fetch --all
git lfs fsck
git lfs checkout
git lfs status