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:
cat .gitmodules |while read i
do
if [[ $i == \[submodule* ]]; then
mpath=$(echo $i | cut -d\" -f2)
read i; read i;
murl=$(echo $i|cut -d\ -f3)
mcommit=`eval "git submodule status ${mpath} |cut -d\ -f2"`
mname=$(basename $mpath)
echo -e "$name\t$mpath\t$murl\t$mcommit"
git submodule deinit $mpath
git rm -r --cached $mpath
rm -rf $mpath
git remote add $mname $murl
git fetch $mname
git branch _$mname $mcommit
git read-tree --prefix=$mpath/ -u _$mname
fi
done
git rm .gitmodules
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 the dotfiles
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 the dotfiles
.
git remote add -f prezto user@example.com:path/prezto.git
Merge the prezto
project into the local dotfiles
project. This doesn't change any of your files locally, but it does prepare Git for the next step.
git merge -s ours --no-commit prezto/master
Create a new directory called prezto-subdir
(or whatever you like), and copy the Git history of the prezto
project into it.
git read-tree --prefix=prezto-subdir/ -u prezto/master
Commit the changes to keep them safe.
git commit -m "Subtree merged in prezto"