Re: Merging two Git-Repositories
- From
- Jared Tobin <jared@jtobin.io>
- Date
- Dec 17, 2019, 11:03 UTC
- Message-ID
- <20191217110354.GA82154@castor>
- In-Reply-To
- <trinity-c6dbf360-5abe-43df-8428-85514195a7a6-1576574916643@3c-app-gmx-bs62>
On Tue, Dec 17, 2019 at 10:28:36AM +0100, Steve Keller wrote:
> Is it possible to merge one Git-Repository into another? I have > developed two independent repositories A and B, and now I find that B > should be part of A in new sub-directory, e.g. A/B. I want to move B > into A while keeping the whole development history of B.
You can accomplish this with git-subtree(1), for which IMO the intuition of "exotic merge commit" more or less suffices.
An example (from A):
git remote add B B_REMOTE_ADDRESS git subtree add --prefix B B master
-- jared