Using Git LFS to Manage Large File Storage - Blogs
X
16Nov

Using Git LFS to Manage Large File Storage

Git LFS (Huge File Storage) is an open-source Git extension that was created by Atlassian, GitHub, and few other open-source contributors. It minimizes the impact of large files in your repository by downloading the necessary copies of them slowly. 

Small file storage was the original purpose of Git. Uploading some huge files is necessary in some circumstances, though. Git Large File Storage (Git-LFS) was developed in order to speed up and reliably store large files on Git. Git LFS can be used to version huge files that are larger than the GitHub limit (100mb), typically valuable output data. Both plain text and binary files can be present. 

The setup of Git-LFS and the integration of Git LFS into your existing workflow, regardless of whether you utilize- 

  1. GitHub’s web interface 

  1. Command line 

  1. GitHub Desktop application 

Setting up Git for Large File Storage 

Step-1: Open Git Bash Download the Git LFS, before that first you need to install Git and then install the Git-LFS. 

   

Step-2: After you download and install Git LFS, you can start managing large files in a Git repository by running git lfs track , where is a command-line glob specifying a particular file, extension, directory, or any combination. Git LFS writes these globs to a .gitattributes file in your repository that Git uses to pre-process files as they move back and forth from your working directory to your index and commit history. 

 

Step-3: Once you tell Git LFS which files and paths to manage, you can stage, commit, and push just like you normally would; Git LFS handles all the details for you. When you run git push, you’ll notice a progress indicator showing the transfer status of each file as Git LFS uploads it to the LFS server. 

 

Step-4: If you ever need to find out which paths Git LFS is managing, you can run git lfs track with no arguments. You’ll get an output of all the tracking rules from the globs listed in the .gitattributes file. For a deeper view of which specific files these globs are catching, you can run git lfs ls-files to see a listing of all the files in your project that Git LFS is managing. 

 

How to clone a repository with large file storage  

  • Make sure Git-LFS is set up before downloading the Git repository that contains huge files. 

  • The repository you cloned would otherwise only have the shortcuts to the huge files. It won't help to install Git-LFS after the repository has been cloned. Git pull and git fetch won't take care of replacing your huge file shortcuts for you automatically. 

  • Simply delete the repository if you've previously cloned it, check that Git-LFS is properly installed, then clone once more. 

  • The huge files will be correctly copied in this manner. 

Benefits of using Git-LFS 

  • Users can conserve space by storing binary files in a different location by using the Git LFS extension. 

  • Per Git Large File Storage-enabled GitHub account gets 1 GB of free storage and 1 GB of free bandwidth each month. 

Reference Links: 

Related

Displaying Postscript text and Vector images on PDF in C#.net using Imageglue

Postscript is a language used for creating vector Images,Vector images are made up of many scalable ...

Read More >

Pivoting and Unpivoting Data In SQL Server 2008

In this blog, I would like to explain about PIVOT and UNPIVOT operator in SQL Server. The PIVOT oper...

Read More >

Overview of Microsoft Dynamics CRM 2013

What is CRM  Today’s world is fast changing and full of challenges, which fundamenta...

Read More >

Connect apps and integrate data with workflows using Azure Logic Apps

Implementing complex business process has been made easy. Logic Apps in azure provide a way to imple...

Read More >

Threading

Multi-taskingIt is a concept of performing multiple tasks over a certain period of time by executing...

Read More >

Azure App Service Scaling Features And Capabilities

How to scale the application in Azure App Service. There are two workflows for scaling, scale up and...

Read More >

Creating a Simple Form with Validation Using ASP.NET MVC 4 Empty Template

There are multiple Validation attributes available in MVC. Validation attributes comes from System.C...

Read More >

Security Feature & Permission Access Capabilities in GHAS (GitHub Advanced Security)

Customers who purchase an Advanced Security license from GitHub get access to additional security ca...

Read More >

Webinar - The process of version migration from older versions of Navision to NAV 2013 R2

The process of version migration from older versions of Navision to NAV 2013 R2 Effectively planning...

Read More >

Protect and discover secrets using Git-leaks

Git-leaks is a SAST tool for detecting and preventing hardcoded secrets like Passwords, API keys, an...

Read More >

Share

Try DevOpSmartBoard Ultimate complete Azure DevOps End-to end reporting tool

Sign Up

  • Recent
  • Popular
  • Tag
Monthly Archive
Subscribe
Name

Text/HTML
Contact Us
  • *
  • *