Re: How to integrate external repo into existing directory of a bigger repo (git subtree)?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 24.12.20 15:53, Manuel Reimer wrote:
What I want to do is porting this over to "git subtree" somehow, but:

- I would prefer to not loose history in the "big repo"
- I can't force-push to the small external repositories (blocked)

Just for the record: I found a way to fix this properly.

The way to go is:

- Create a new, empty, GIT repository (git init)
- For some reason (bug?) "git subtree" fails on a completely new repo, so I had to add one initial commit (I used this to add a small helper shellscript that I want to use to simplify my "git subtree" work). - Now add all the wanted "git subtrees" from their existing "external repositories" to the, so far, nearly empty repo. This creates a proper "Add ..." commit which seems to be the key to not break pushing to the external repo. - After adding all subtrees, pull from the "big repo", resolve conflicts and create a merge commit.

At this point I was able to "git subtree push" without needing to force. This also transferred proper history for the subtrees to the individual external repos. Even the final push to my "big repo" worked without forcing.

Regards,

Manuel



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux