I'm merging 2 git repositores (old1 & old2) into 1 (new1). My requirements are to merge all branches & to keep the git commit history. First one I can achieve but I'm struggling with the commit history.
This is the command I execute to merge the old1 repo in a sub folder of the new1: git subtree add -P old1 https://github.com/example/old1.git master
Output of git log --graph --oneline --decorate --all
:
* ad4fcb6 (HEAD -> master, origin/master, origin/HEAD) Add 'komed-connector/' from commit '50b42475113c295c66c4050b3b0f119a6ebff62b'
|\
| * 50b4247 Updated komed-shared
| * 1a5435a Merge branch 'master' into openshift_build
| |\
| | * 8aa90aa Merge branch 'r/3.4'
| | |\
| | | * a6cea77 updated shared
| | * | a40c782 Updated komed-shared
...
So far so good: git commit history is kept. But if I'm inspecting the git commits of a single file in the new sub folder it doesn't show all commits:
How can I merge 2 repos into 1 and keep the individual file git commit history? So when running gitk old1/Dockerfile
git shows me all commits that happened on the old repository.