I have a dotfiles repository. I want to merge another one with submodules (prezto) into it, so I can conveniently have everything in one repository without the inconvenience of submodules.
How can I subtree merge prezto into my dotfiles repository with all its submodules?
I can use submodules, I can split and merge subtrees either the "old fashioned" way or with the newer git subtree tool.
I just don't know how to do this specific case.
Alexander Mikhailian created a script to convert all the submodules in subtrees, you should be able to adapt it to your case.
Presenting here the steps:
I think the easiest route for you would be to apply the script on the
prezto
repo and then make the repo a subtree in thedotfiles
repository.After executing the script in the
prezto
repository you will use the following steps to create the subtree:Add a new remote URL pointing to the
prezto
repo into thedotfiles
.Merge the
prezto
project into the localdotfiles
project. This doesn't change any of your files locally, but it does prepare Git for the next step.Create a new directory called
prezto-subdir
(or whatever you like), and copy the Git history of theprezto
project into it.Commit the changes to keep them safe.