← 返回命令列表

Linux command

git-merge-repo 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Merge another repository

git merge-repo [repo-url] [branch] [directory]

Merge repo into subdirectory

git merge-repo [https://github.com/owner/repo.git] main [lib/]

说明

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.

参数

--help
Display help information.

FAQ

What is the git-merge-repo command used for?

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.

How do I run a basic git-merge-repo example?

Run `git merge-repo [repo-url] [branch] [directory]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --help do in git-merge-repo?

Display help information.