0Pricing
DevOps Bootcamp · Lesson

Handling Sensitive Data (Git LFS)

Discover Git LFS (Large File Storage) for managing large files and preventing sensitive data from being committed directly.

Handling Sensitive Data (Git LFS) is a free DevOps Bootcamp lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the DevOps Bootcamp learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Git & The Big File Problem

Have you ever committed a huge file to Git? Maybe a large image, video, or a big dataset?

Git is designed for text-based code, where changes are small. When you add large binary files, your repository quickly becomes bloated, making cloning and operations slow. This can also happen with sensitive data if not careful.

Why Large Files Bloat Repos

Git stores every version of every file in its history. For text files, Git efficiently stores the differences (deltas).

However, for large binary files (like a 50MB Photoshop file or a compiled executable), even a tiny change means Git stores an entirely new 50MB file. Over time, this makes your repository huge and slow.

Introducing Git LFS

To solve this, Git introduced Git Large File Storage (LFS). LFS is an open-source extension for Git that handles large files more efficiently.

It replaces large files in your Git repository with tiny 'pointer' files, while the actual large files are stored on a remote LFS server.

How Git LFS Works

When you commit a file tracked by LFS:

  • Git commits a small pointer file (a text file with a reference to the large file).
  • The actual large file is uploaded to the Git LFS server (often hosted by GitHub, GitLab, or Bitbucket).

When someone clones or pulls, Git downloads the pointer, then LFS fetches the real file.

Installing Git LFS

Before using LFS, you need to install it. If you're on macOS or Windows, you can usually install it via a package manager (like Homebrew) or a dedicated installer.

After installation, you run git lfs install once per system to set up LFS hooks.

git lfs install

Tracking Files with LFS

Once LFS is installed, you tell Git which file types to track using git lfs track. This command adds an entry to your .gitattributes file.

For example, to track all .psd (Photoshop) files:

git lfs track "*.psd"

Committing LFS Tracked Files

After running git lfs track, ensure you commit the .gitattributes file itself. Then, add and commit your large files as usual.

Git will now store the small pointer file in your repository for .psd files.

git add .gitattributes
git add my_large_image.psd
git commit -m "Add large PSD file with LFS"

Pushing LFS Files

When you push your changes to a remote repository, Git LFS automatically handles the large files. It uploads the actual large files to the LFS server associated with your remote.

The process feels seamless, just like a regular git push.

git push origin main

Viewing LFS Status

You can see which files are currently being tracked by Git LFS in your repository using the git lfs ls-files command.

This helps confirm that your large files are correctly managed by LFS.

git lfs ls-files

LFS Benefits Check

Which of the following is a primary benefit of using Git LFS?

Recap: Git LFS Power

You've learned how Git LFS helps manage large files in your repositories. By storing pointers in Git and actual files on an LFS server, it prevents repository bloat and improves performance.

Remember to always use git lfs track for your large binary files and commit the .gitattributes file.

Frequently asked questions

Is the “Handling Sensitive Data (Git LFS)” lesson free?

Yes — the full text of “Handling Sensitive Data (Git LFS)” is free to read here on the web, and the DevOps Bootcamp course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the DevOps Bootcamp course, upgrade to CoddyKit PRO.

What will I learn in “Handling Sensitive Data (Git LFS)”?

Discover Git LFS (Large File Storage) for managing large files and preventing sensitive data from being committed directly. You practise DevOps Bootcamp with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start DevOps Bootcamp?

No prior experience is required. DevOps Bootcamp on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Handling Sensitive Data (Git LFS)” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this DevOps Bootcamp lesson?

Yes. Every DevOps Bootcamp lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Securing Your Git Workflow
  2. Handling Sensitive Data (Git LFS)
  3. Best Practices for Commit Messages
  4. Signing Commits and Tags with GPG
← Back to DevOps Bootcamp