Git

About GIT-LFS

date
Apr 11, 2023
slug
About GIT-LFS
author
status
Public
tags
Git
Github
summary
type
Post
thumbnail
category
Git
updatedAt
Apr 28, 2023 01:21 AM

git-lfs

What is git-lfs??

git-lfs is kinda of pointer hash which has infomation about file address of cloud data stroage.
  • You can uploade and manage revision of large file (>100MB)

Install

Linux(Debian): apt-get install git-lfs
Linux(Red Hat): yum install git-lfs
macOS(brew): brew install git-lfs
Windows: <https://git-scm.com/docs/git-commit>

Quick Start

# In repository dir
$ git lfs install

# Remove cached file that you want to uploade to git-lfs
$ git rm --cached (file path)

# Add file to git-lfs
$ git lfs track (file path)

# Then you see the file path in `.gitattributes`
# Commit and Push
 

If you want to delete file in git-lfs then uninstall and re-install in repo

$ git lfs uninstall
 

Q. 용량 초과로 Git LFS disabled 메일을 받았을 경우

  1. 레포지토리 삭제
  1. 초기화git add --renormalize .
  1. https://docs.github.com/en/repositories/working-with-files/managing-large-files/removing-files-from-git-large-file-storage
  1. git-lfs uninstall하고 git에서 파일관련된 거 지워서 트랙된거 다 제거 후에 다시 git-lfs 설정 (삭제 후 track): git-lfs도 large file에 대한 리비전 관리를 목적으로 하므로, 파일 변경시 용량이 계속 축적되므로 1.5GB 금방 넘으니까 마지막에 1GB 내외의 파일만 한번에 업데이트 추천