Performing the merge shows example.txtin BProject/masterboth renamed dir-B/example.txt. git logdoes not track the history of the file / directory after renaming, if the option is not used --follow:
--follow
Continue listing the history of a file beyond renames (works only for a single file).
, BProject/master, dir-B, . , SHA , BProject/master! , , .
, Bproject, :
git-filter-branch manpage
To move the whole tree into a subdirectory, or remove it from there:
git filter-branch --index-filter \
'git ls-files -s | sed "s-\t\"*-&newsubdir/-" |
GIT_INDEX_FILE=$GIT_INDEX_FILE.new \
git update-index --index-info &&
mv "$GIT_INDEX_FILE.new" "$GIT_INDEX_FILE"' HEAD
, , , .