DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
What's in store for DevOps in 2023? Hear from the experts in our "DZone 2023 Preview: DevOps Edition" on Fri, Jan 27!
Save your seat
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Deployment
  4. Learning Git: What is Git LFS?

Learning Git: What is Git LFS?

Instead of creating a whole new file for your binary files in your repo, learn how you can use this application to pull only what you need.

Jonathan Silva user avatar by
Jonathan Silva
·
Jan. 15, 19 · Presentation
Like (2)
Save
Tweet
Share
5.11K Views

Join the DZone community and get the full member experience.

Join For Free

Git LFS stands for Large File Storage and is a tool many developers use to save space when working with binary files.

Watch This Quick Video or Keep Reading to Learn More!



What Is Git LFS?

In short, Git LFS is a Git extension that allows users to save space by storing binary files in a different location. Let’s dig in a bit to learn more about why you would want to use Git LFS and how it works.

Why Use Git LFS?

When working with repositories that contain audio, video, or image files (aka binary files), any changes made to those files are not tracked through Git in the same way that non-binary files are tracked.

While Git does a great job of tracking changesets in text files, changes made to binary files are tracked as an additional copy of the file.

Imagine you are working with a binary image that takes up 100MB on your repo and you make a change to that file. Git will track that change on a file that also takes up 100MB of space and will continue to do that for each change made.

If you want to do some quick math, four file changes made to a binary 100MB file would result in a total of 500MB used (100MB original file + 100MB change file + 100MB change file + 100MB change file + 100MB change file = 500MB).

Because these changes also get pushed to your remote, your remote will also grow in size, decreasing the speed in which you can clone, push, pull, or perform other operations with your repo.

How Does Git LFS Save Time?

When using Git LFS, your commits will point to a lightweight reference object instead of pointing back to the binary file (you’re actually pushing the original binary file to an LFS repo).

Now, when you clone the LFS repo or check out a branch in an LFS repo, you will only pull the version of the binary file that you need from the LFS server, saving space and time.

How Does Git LFS Work in GitKraken?

Before using Git LFS in GitKraken, you must first install Git LFS on your machine. You will also need to set up your LFS server, and if you’re just getting started, GitHub has a built-in free option available here.

Once installed, navigate to Preferences to access the LFS option.

You may then initialize LFS for an existing repo and specify the file types you need the application to track.

After you complete the initialization process, an LFS icon will appear in the toolbar, allowing you to interact with the files on your LFS server.

Where Can I View LFS Files?

All files tracked by LFS will be marked with the LFS icon in the Right Panel of GitKraken.

When you click to view the diff of such a file, you will see the SHA reference instead of your large file.

Finally, you may check the option to initialize the LFS application when you Init any repo from GitKraken.

We hope this helps explain the benefits of using a Git Large File Server and how easy it is to utilize the application in GitKraken.

Git

Published at DZone with permission of Jonathan Silva, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • ChatGPT Prompts for Agile Practitioners
  • Differences Between Site Reliability Engineer vs. Software Engineer vs. Cloud Engineer vs. DevOps Engineer
  • Kubernetes vs Docker: Differences Explained
  • Iptables Basic Commands for Novice

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: