Skip to content
Jstobigdata Logo Jstobigdata Logo Jstobigdata Logo
  • Java™
    • Microservices TutorialNew
    • Spring Core Tutorial
    • Spring AOP Tutorial
    • Project Reactor Tutorial
    • RabbitMQ Tutorial
    • JMS 2.0 Tutorial
    • Design patterns
    • JPA with Hibernate
    • Apache Maven
  • JavaScript
    • Data Structure
    • RxJS Tutorial
  • DevOps
    • Docker Tutorial
    • Git
    • Agile
  • Coming soon
    • Python™
    • Elasticsearch
    • Big Data
    • Node.js®
    • Emberjs
    • Vue.js
    • Angular
    • Spring Security

Handle Large Files in Git using Git-LFS

Home/Git, Tools/Handle Large Files in Git using Git-LFS
Handle Large Files in Git using Git-LFS

GIT LFS - Git extension for versioning large files

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. However, Git was not originally designed to work with large files, where single file size can be from few Mb to several Gb. GitHub and other service providers have a maximum size limit on the file size, e.g. GitHub max size limit of a single file is 100MB. Git-lfs helps to overcome this problem.

GIT LFS (Large File Storage) is a Git extension for versioning large files.

Getting Started with git-lfs

  • Download and install Git LFS from official site. There are several options available for installations, for Mac brew install git-lfs
  • Verify that git-lfs is installed successfully by running git lfs install from any directory.
  • Now navigate to your git repository where you would like to manage large files using Git LFS cd your_repo_dir . If you are creating a new repository, make sure you have run git init.
  • Configure the files that need to be tracked by git lfs as git lfs track "*.psd"
  • Make sure .gitattributes is tracked as part of the change logs by running git add .gitattributes

How does git-lfs work?

Projects with large files, particularly large files that are modified regularly, git initial clone can take a huge amount of time. This is because every version of every file needs to be downloaded by the client. Git LFS (Large File Storage) reduces the impact by lazily downloading the relevant versions.

Git LFS downloads the large files during checkout process rather than downloading during cloning or fetching.

Git LFS does this by replacing the large files in your repo with tiny pointer files.

  1. When a new file is added, Git LFS replaces its contents with a pointer, and stores the file contents in a local Git LFS cache.
  2. Upon git push to remote, any Git LFS files linked to pushed commits are transferred from your local Git LFS cache to the remote Git LFS store.
  3. Upon git checkout, if this commit contains Git LFS pointers, they are replaced with files from local Git LFS cache, or downloaded from the remote Git LFS store.

Git LFS seamlessly integrates with existing git workflow, you simply use the same set of git commands.

By Bikram Kundu|2019-08-08T04:14:32+00:00February 20th, 2019|Categories: Git, Tools|Tags: git, git-lfs|

Share This Page, Choose Your Platform!

FacebookTwitterRedditLinkedInWhatsAppPinterestEmail

Leave A Comment Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Table of Contents

  • GIT LFS – Git extension for versioning large files
  • Getting Started with git-lfs
  • How does git-lfs work?

Recent Articles

  • Circuit Breaker Pattern in Microservices
  • Service Discovery Patterns in Microservices
  • The API Gateway Pattern in Microservices
  • Introduction to Microservices Architecture
  • Getting Started with JUnit 5
  • Spring @Import and @ImportResource annotations
  • Handle Resources in Spring
  • JUnit 5 – Software Testing Framework
  • Spring WebFlux REST Api with MongoDB and Spring Data
  • A functional endpoint in Spring WebFlux

Recent Posts

  • Circuit Breaker Pattern in Microservices
  • Service Discovery Patterns in Microservices
  • The API Gateway Pattern in Microservices
  • Introduction to Microservices Architecture
  • Getting Started with JUnit 5
  • Spring @Import and @ImportResource annotations
  • Handle Resources in Spring
  • JUnit 5 – Software Testing Framework
  • Spring WebFlux REST Api with MongoDB and Spring Data
  • A functional endpoint in Spring WebFlux

Categories

About Jstobigdata

  • About us
  • Contact us
  • Privacy Policy
  • Terms & Conditions
  • Sitemap
© Copyright | All Rights Reserved | Created by Bikram Kundu
FacebookLinkedInReddit
Page load link
Jstobigdata uses cookies and third party services. OK
Go to Top