A project team is setting up a new Git repository in Azure DevOps. They want to prevent large binary files (e.g., compiled executables, large datasets) from being committed directly into the repository, as this would inflate its size and negatively impact clone times. However, these files are necessary for some build processes and need to be tracked and versioned. Which Git feature should they integrate with their repository?
- AGit Large File Storage (LFS)
- BAzure Artifacts Universal Packages
- C.gitignore file
- DGit hooks for pre-commit checks
Show answer & explanationAnswer & explanation
Correct answer: A. Git Large File Storage (LFS)
Git Large File Storage (LFS) is a Git extension that handles large files by replacing them with text pointers in the Git repository while storing the actual file contents on a remote server. This keeps the Git repository small and fast, while still allowing large files to be tracked and versioned.
Why the other options are wrong
- B. Azure Artifacts Universal Packages are for distributing build outputs, not for managing large binary source files within the Git repository itself.
- C. .gitignore prevents files from being committed, but it does not track or version them, which is a requirement.
- D. Git hooks can prevent large files from being committed, but they don't provide a mechanism for tracking and versioning those files externally.
Git Large File Storage (LFS)
A Git extension for versioning large files (binaries, audio, video, datasets) by storing pointers in the Git repository and the actual content on a remote LFS server.
- Keeps Git repository size small and clone times fast.
- Allows large files to be versioned alongside code.
- Requires Git LFS client installation and configuration.
Memory trick: Think of Git LFS as a smart bouncer for your Git repo: it lets large files (elephants) into the club, but only their 'tickets' (pointers) go on the official guest list, while the elephants themselves wait in a special VIP lounge (LFS server).