How to Clone the AI for Beginners Repository Without Translations: A Sparse Checkout Guide

Use Git's sparse-checkout feature with --filter=blob:none and --sparse to clone only the core curriculum while excluding the 50+ language translation folders.

The AI-For-Beginners repository by Microsoft is a comprehensive 12-week open-source curriculum for learning artificial intelligence. While the repository includes valuable resources like Jupyter notebooks, Python examples, and an interactive quiz app, it also contains extensive translation files across more than 50 languages. If you only need the English curriculum and want to save disk space and download time, you can clone the repository without translations using Git's modern sparse-checkout capabilities.

Why Clone Without Translations?

The translations/ and translated_images/ directories contain localized versions of lesson content for global accessibility. However, these folders add substantial size to the repository. According to the README.md in the Microsoft/AI-For-Beginners repository, skipping these directories gives you a lightweight copy that still includes:

  • All 12 weeks of lesson notebooks in lessons/
  • Self-contained Python examples in examples/
  • The Vue-based interactive quiz application in etc/quiz-app/
  • Conda environment configuration in environment.yml

Sparse Checkout Method: Step-by-Step

Git's sparse-checkout feature allows you to download only specific paths from a repository. Combined with partial clone (--filter=blob:none), this defers fetching file content until it's actually needed.

Step 1: Clone with Partial Clone and Sparse Options

git clone --filter=blob:none --sparse https://github.com/microsoft/AI-For-Beginners.git

The --filter=blob:none flag tells Git to fetch only commit metadata initially. The --sparse flag enables sparse-checkout mode automatically.

Step 2: Navigate Into the Repository

cd AI-For-Beginners

Step 3: Define Sparse-Checkout Patterns

Use the --no-cone mode for fine-grained path exclusion. Include everything (/*) but explicitly exclude the translation directories:

Bash / macOS / Linux:

git sparse-checkout set --no-cone '/*' '!translations' '!translated_images'

Windows CMD:

git sparse-checkout set --no-cone "/*" "!translations" "!translated_images"

This configuration writes to .git/info/sparse-checkout, making the exclusions persistent for future git pull operations.

Verify Your Lightweight Clone

After configuration, confirm the translation directories are absent:

ls -d */

You should see core folders like lessons/, examples/, etc/, and binder/ — but not translations/ or translated_images/.

Adding Translations Back Selectively

If you later need a specific translation, add it without re-cloning:

git sparse-checkout add translations/zh-CN
git pull

This fetches only the requested translation files on demand.

What You Keep: Core Repository Structure

Path Contents
lessons/ 12 weeks of Jupyter notebooks covering AI fundamentals through deep learning
examples/ Standalone Python scripts: Hello AI, simple neural networks, and more
etc/quiz-app/ Vue 2.x application powering interactive lesson quizzes
environment.yml Conda environment with dependencies for running notebooks
binder/ Binder configuration for cloud Jupyter deployments

Shell-Specific Command Reference

Platform Exact Command
bash/zsh git sparse-checkout set --no-cone '/*' '!translations' '!translated_images'
Windows CMD git sparse-checkout set --no-cone "/*" "!translations" "!translated_images"
PowerShell Same as CMD; ensure quotes are standard double quotes

Summary

  • Git sparse-checkout with --filter=blob:none creates a minimal clone of AI-For-Beginners without translation bloat
  • The pattern '/*' '!translations' '!translated_images' preserves all core curriculum files
  • Configuration persists in .git/info/sparse-checkout for future updates
  • Individual translations can be added later with git sparse-checkout add

Frequently Asked Questions

What Git version do I need for sparse-checkout?

Git 2.25 or later is required for full sparse-checkout support with --no-cone. Most modern distributions include this; verify with git --version.

Does sparse-checkout affect git pull or git fetch?

No. The sparse-checkout patterns remain active for all Git operations. Subsequent git pull commands automatically respect your exclusions — new translation files won't appear unless you modify the sparse-checkout set.

Can I use this method to exclude other directories instead?

Yes. The --no-cone pattern syntax supports any path exclusions. Replace or append to !translations and !translated_images with other directory names you want to skip, such as !lessons/7-NLP if you're not studying natural language processing.

How much space does this actually save?

The Microsoft/AI-For-Beginners repository contains 50+ language translations with accompanying images. While exact savings vary by commit history, sparse-checkout typically reduces the initial download from several hundred megabytes to under 100 MB for the core curriculum alone.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →