I want to copy a (local) Git repository into a subdirectory of another, already existing Git repository while keeping the history intact.
I already tried
cd already-existing-target-repo/
git subtree add -P modules/rocket-module C:/DEV/java/repositories/rocket-module.git/ master
but the command does not import the commit history.
I also thought about trying an approach from here, where the source repository was added as a remote to the target repository, including a subsequen checkout and moving step. But unfortunately there are several files with the same name (i.e. pom.xml).
How can I keep the commit history?