Enable Git LFS to Manage Binary Files

Open
#830 1 comment 1 reaction 1 assignee View on GitHub

@lunika is already working on this.

Since Apr 6, 2025.

Assessment

This issue has not been assessed yet.

Description

enhancement

Proposal: Enable Git LFS to Manage Binary Files

Some files in this repository are stored in binary format. Since Git cannot store differences for binary files, any change results in the full file being stored in history. This can lead to:

  • Repository bloat and degraded performance over time
  • Slower clone operations
  • Increased CI times due to larger downloads

To address these issues, Git LFS (Large File Storage) was created. Git LFS replaces large binary files with lightweight pointers in the repository while storing the actual contents externally.

See the official guide for setup instructions:
https://docs.github.com/en/repositories/working-with-files/managing-large-files/configuring-git-large-file-storage

Below is a handy script that scans the repository for binary files and reports their sizes in a human-readable format (requires ripgrep):

#!/usr/bin/env bash

# This script finds and lists all binary files recursively in the current directory.
total_bytes=0
while read -r file; do
    # Exclude files ignored by git
    if git check-ignore -q "$file"; then
        continue
    fi
    # Determine the file size
    size=$(stat -c%s "$file")
    # Skip empty files
    if [ "$size" -eq 0 ]; then
        continue
    fi
    # Use file -i to check if the file is binary (has charset=binary)
    if file -i "$file" | grep -q "charset=binary"; then
        # Report file and its size in human-readable format
        echo "$file - $(numfmt --to=iec $size)"
        total_bytes=$((total_bytes + size))
    fi
done < <(rg --files -g '!.git')
# Report the total size in human-readable format
echo "Total binary size: $(numfmt --to=iec $total_bytes)"

Enabling Git LFS will help keep the repository lean and maintain better performance over time.

Dominant language
Python
Stars
16.8k
Forks
638
Avg merge
1d 15h
Merged PRs (30d)
40

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from suitenumerique/docs

All issues in suitenumerique/docs

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.