LinuxCommandLibrary

git-merge-repo

Merge repository into subdirectory

TLDR

Merge another repository

$ git merge-repo [repo-url] [branch] [directory]
copy
Merge repo into subdirectory
$ git merge-repo [https://github.com/owner/repo.git] main [lib/]
copy

SYNOPSIS

git merge-repo url branch directory

DESCRIPTION

git merge-repo merges another repository into a subdirectory while preserving its full commit history. It handles the complex process of combining two separate repository histories with directory relocation.
The command is useful for incorporating external libraries, consolidating multiple repositories into a monorepo, or absorbing a project that was previously maintained separately.

PARAMETERS

URL

Repository URL to merge.
BRANCH
Branch to merge from.
DIRECTORY
Target subdirectory.
--help
Display help information.

CAVEATS

Part of git-extras package. Complex operation. May need conflict resolution.

HISTORY

git merge-repo is part of git-extras, providing repository consolidation functionality for monorepo creation and library incorporation.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community