Now I know most git experts will immediately think of git rebase
, but I am using the word \"rebase\" in the more general sense: I have the following structure o
I needed to do the same thing and this worked for me:
From the parent repo,
git remote add -f subrepo git@github.com:sub/repo.git
git merge -s ours --no-commit subrepo/master
git read-tree --prefix=subrepo/ -u subrepo/master
git commit -m "Subtree merged"
This is from a GitHub post that also has more detail: https://help.github.com/articles/about-git-subtree-merges/