Menu

Merge repositories and keep history

There is a special command git-subtree to merge / split repositories. It is not installed as a part of git package:

sudo dnf install git-subtree

The command to merge repository jsnjack/X to subfolder myfolder/new at branch master:

git subtree add -P myfolder/new git@github.com:jsnjack/X.git master
· 25 Nov 2021