Microsoft Certified: DevOps Engineer ExpertDesign and implement source controlMedium

A company is developing a machine learning application. Their build pipeline generates large model files (e.g., `.pkl`, `.h5`) that are too large to be stored efficiently in Git. These files are outputs of a training process and need to be versioned along with the code that generated them. The team wants to use Git for source control but needs a way to manage these large binary files without bloating the repository or degrading Git performance. Which solution should they implement?

  1. AUpload model files to Azure Blob Storage and store only URLs in Git.
  2. BStore model files directly in the Git repository and use shallow clones.
  3. CExclude model files from Git using `.gitignore` and manage them separately.
  4. DUse Git Large File Storage (LFS) to track the large model files.
Show answer & explanation

Correct answer: D. Use Git Large File Storage (LFS) to track the large model files.

Git Large File Storage (LFS) is specifically designed to handle large binary files within a Git workflow. It replaces large files with small text pointers in Git, storing the actual file contents on a remote LFS server. This prevents repository bloat and maintains Git's performance while still allowing versioning of large files alongside code.

Why the other options are wrong

  • A. While Azure Blob Storage can store large files, storing only URLs in Git means the files are not versioned with Git itself and requires custom logic to retrieve them, complicating the workflow.
  • B. Storing large files directly in Git is exactly what LFS aims to prevent, as it bloats the repository history and degrades performance.
  • C. Excluding files with `.gitignore` means they are not versioned at all, which contradicts the requirement to version them along with the code.

Git Large File Storage (LFS)

An open-source extension for Git that replaces large files in your repository with text pointers, while the actual file contents are stored on a remote server.

  • Prevents Git repository bloat and performance degradation.
  • Allows versioning of large binary files alongside source code.
  • Requires Git LFS client installation and configuration.
  • Integrates seamlessly into existing Git workflows.

Memory trick: LFS handles large files, so Git stays nimble.

More Design and implement source control questions