git-subtree
Merge and split repositories using subdirectories
TLDR
SYNOPSIS
git subtree command [options]
DESCRIPTION
git subtree merges and splits repositories into subdirectories, providing an alternative to submodules. Unlike submodules, subtrees keep everything in a single repository with a unified history, so clones don't need any extra init/update step to get the vendored code.The `split` command extracts the history of a subdirectory into a separate branch, while `add`, `pull`, and `push` manage the ongoing synchronization with the upstream repository.
PARAMETERS
--prefix dir
Subdirectory for subtree.--squash
Squash history.-b branch
Branch name for split.
SUBCOMMANDS
add
Add repository as subtree.pull
Pull subtree changes.push
Push subtree changes.merge
Merge subtree changes.split
Extract subtree history.
INSTALL
CAVEATS
Shipped as a `contrib` script, not part of the core `git` binary, so it isn't installed everywhere by default (e.g. some Linux distros package it separately, such as Debian/Ubuntu's `git-subtree` package). Merging a large upstream history in still adds all of its commits to your repository.
SEE ALSO
git-submodule(1), git-merge(1)