How to Clone the AI for Beginners Repository Without the Translations Directory

Use Git's sparse-checkout feature with --filter=blob:none and --sparse options to exclude the translations and translated_images directories while retaining the core curriculum, lessons, and examples.

The microsoft/AI-For-Beginners repository contains a comprehensive 12-week curriculum for learning artificial intelligence, accompanied by over 50 language translation folders that significantly increase repository size. If you only need the English core content and Jupyter notebooks, you can clone the AI for Beginners repository without the translations directory using Git's modern partial clone capabilities. The official README.md documents this exact workflow to help learners reduce download time and local storage usage.

Why Exclude the Translations Directory?

The AI for Beginners project includes extensive localization support with translation folders for more than 50 languages. While valuable for global accessibility, these files add substantial bulk to the repository. By excluding the translations and translated_images directories, you retain access to all lesson notebooks, example scripts, and the Vue-based quiz application while minimizing the initial clone footprint.

Prerequisites

You need Git 2.25 or later to use the sparse-checkout feature with the --cone and --no-cone options. Verify your version with:

git --version

Step-by-Step: Clone AI for Beginners Without Translations

According to the repository's README.md (lines 31-48), the sparse-checkout process requires three specific steps: performing a partial clone, entering the directory, and defining exclusion patterns.

Bash/Linux/macOS

Run these commands in your terminal:

git clone --filter=blob:none --sparse https://github.com/microsoft/AI-For-Beginners.git
cd AI-For-Beginners
git sparse-checkout set --no-cone '/*' '!translations' '!translated_images'

Windows Command Prompt

For Windows CMD, use double quotes instead of single quotes:

git clone --filter=blob:none --sparse https://github.com/microsoft/AI-For-Beginners.git
cd AI-For-Beginners
git sparse-checkout set --no-cone "/*" "!translations" "!translated_images"

How Sparse-Checkout Works

The --filter=blob:none option tells Git to download only repository metadata initially, deferring file content until needed. The --sparse flag enables sparse-checkout mode immediately upon cloning.

When you run git sparse-checkout set --no-cone, Git writes the inclusion and exclusion patterns to .git/info/sparse-checkout. The pattern /* includes all top-level files and directories, while !translations and !translated_images explicitly exclude those heavy folders. This configuration persists for future git pull operations, ensuring the excluded directories remain absent unless explicitly added back.

Verifying Your Clone

After running the sparse-checkout commands, confirm that the translation directories are absent while core content remains:

ls -d */

You should see directories like lessons/, examples/, binder/, and etc/, but not translations/ or translated_images/. The lessons/ directory contains all 12 weeks of curriculum notebooks, while examples/ holds self-contained Python scripts demonstrating basic AI concepts.

Restoring Translations Later

If you later need specific language support, you can add individual translation folders without recloning:

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

This fetches only the requested translation files while keeping other languages excluded.

Summary

  • Sparse-checkout is the recommended method to clone the AI for Beginners repository without the translations directory, as documented in the official README.md.
  • Use --filter=blob:none --sparse during the initial clone to defer downloading file contents until they are required.
  • Exclude translations and translated_images using the --no-cone pattern syntax: '/*' '!translations' '!translated_images'.
  • This approach preserves access to the full curriculum in lessons/, example scripts, the environment.yml Conda configuration, and the Vue-based quiz app in etc/quiz-app/.
  • The exclusion persists across future pulls but can be reversed using git sparse-checkout add for specific languages.

Frequently Asked Questions

What is the AI for Beginners repository?

The microsoft/AI-For-Beginners repository is an open-source educational project containing a 12-week curriculum for learning artificial intelligence fundamentals. It includes Jupyter notebooks, Python examples, a Vue-based quiz application in etc/quiz-app/, and extensive multilingual translations. The repository serves as a comprehensive starting point for developers new to AI and machine learning.

How much space does excluding translations save?

While exact savings vary as the repository grows, the translations and translated_images directories contain localized content for over 50 languages, representing a significant portion of the repository's total size. Using sparse-checkout to exclude these folders reduces the initial clone to only the core English curriculum, examples, and supporting configuration files like environment.yml and binder/requirements.txt.

Can I clone specific lessons instead of the whole repository?

Git sparse-checkout operates on directory patterns rather than individual files. While you cannot easily clone a single notebook, you can exclude large directories like translations/ while keeping the lessons/ directory intact. For truly minimal clones, you would need to use additional --filter combinations, though this may break internal links within the curriculum.

Will sparse-checkout affect future git pull operations?

Yes, the sparse-checkout configuration stored in .git/info/sparse-checkout persists across all Git operations. When you run git pull, Git will only fetch updates for files matching your inclusion patterns, continuing to skip the excluded translations and translated_images directories. This keeps your local repository lightweight indefinitely unless you modify the sparse-checkout patterns using git sparse-checkout set or git sparse-checkout add.

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 →