Based on r3m0t's idea of rewriting history, following lines did the whole trick for me, to merge the other git repository as new branch into my existing one into a sub directory:
(working in git-sh
I could omit the leading 'git' for commands)
co -b my-new-branch
remote add -f origin-my-old-standalone-project ../my-old-standalone-project/
pull origin-my-old-standalone-project master
mkdir my-new-subdir
ci -am "merge 'old' standalone project as new branch 'my-new-branch'"
git filter-branch --index-filter \
'git ls-files -s | sed "s%\t\"*%&my-new-subdir/%" |
GIT_INDEX_FILE=$GIT_INDEX_FILE.new \
git update-index --index-info &&
mv "$GIT_INDEX_FILE.new" "$GIT_INDEX_FILE"' HEAD
After that I had both: A history for individual files in the new sub directory as if they have been there all the time, and the normal history in the main directory, as if the new files in the sub directory always had been there.
(As you can see, no read-tree or any other not daily used commands are necessary, the 'filter-branch' does the whole trick.) IDE's are able (resp. should be; successfully tested PyCharm) to work normally with the result.
After that you should be able to merge your branches as normally, getting all projects into one.
tl;dr: --follow
works as expected, normal history also, after executing above 6 commands to merge old git project into new branch and sub directory of other git project