git-subtree

Vendor third-party code into a Git repository using subtree operations.

1|Updated Apr 20, 2026
One-click install
npx skills add https://github.com/IndianBoy42/dot-opencode --skill git-subtree
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: git-subtree
Source: https://github.com/IndianBoy42/dot-opencode/tree/main/skills/git-subtree
Command: npx skills add https://github.com/IndianBoy42/dot-opencode --skill git-subtree

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Git subtree helps vendoring external dependencies into a monorepo without submodules, enabling controlled updates and easier collaboration.

Core Features & Use Cases

  • Pull-only (soft fork): integrate third-party code locally while keeping upstream history isolated.
  • Push-pull workflows: own and push changes back to remote repositories when needed.
  • Safe history management: squash merges on pulls to keep a clean project history and simplify merges.

Quick Start

Use git subtree to add a vendored directory from a remote, then pull updates with squash for a clean history.

Frequently Asked Questions about git-subtree

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I vendor external dependencies into a monorepo without using submodules?▼

Vendoring external dependencies into a monorepo without submodules is done using git subtree to integrate third-party code locally while keeping upstream history isolated. This method enables controlled updates and easier collaboration across your repository.

What is the best way to manage third-party code in a Git repository?▼

Managing third-party code in a Git repository is best handled by vendoring it with git subtree, which supports both pull-only soft forks and push-pull workflows. This allows you to selectively push changes back to owned remotes when needed.

How do I pull upstream updates into a vendored directory and keep history clean?▼

To pull upstream updates into a vendored directory and keep history clean, you should use squash merges during git subtree operations. Squash merges prevent upstream history from polluting your project and simplify future merges.

Can I push local changes back to an external remote repository using git subtree?▼

Pushing local changes back to an external remote repository with git subtree is fully supported through push-pull workflows. You can own and selectively push changes back to remote repositories when you have ownership of the external upstream.

Does vendoring dependencies with git subtree require any specific Git environment setup?▼

Vendoring dependencies with git subtree requires valid remotes and consistent commit discipline to function correctly. You need a standard Git environment configured with the appropriate remote repository URLs before executing subtree operations.