LinuxCommandLibrary

git-merge-repo

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 history. It combines two repositories, placing the merged content in a specified directory.
The command handles the complex process of combining histories with directory relocation. It's useful for incorporating libraries or consolidating repositories.
git merge-repo enables repository consolidation with history.

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

Copied to clipboard