Re-written history seems to be missing when merging a branch after using "subtree add"

Viewed 73

I have successfully used git subtree add to import an external git repo, with history, into a new folder into my local repo.

git subtree add -P <path> <external repo>.git HEAD

I had branched my repo first, when I merged back into our main branch it succeeded but while I can see the main commit adding all the files, all the rewritten history entries from the external repo seem to be missing. In fact, when I switch back to my branch in which I did the changes, these history entries appear to missing there too! This seems particularly odd.

We use a typical authoritative master remote (Devops) with each developer having a local clone; when I want to add a subtree, what is the right way to get this into our remote origin's main main branch so everyone else gets it next time they pull, and it's included in future branches? Rewritten history presumably doesn't really count as a normal commit, how do I make sure it doesn't get missed?

0 Answers
Related