I have found a few similar topics but please take a look at my solution. It looks like git subtree is intended to solve a slightly different problem. I have two repositories A and B. Repo B has only one directory which is unrelated with the repo A content. I only want to add that directory to repo A and have one consistent history in repoA. Repo B will not be used anymore.
Here are steps:
cd RepoB
git checkout develop
git remote set-url origin RepoA
git pull origin develop
git push -u origin develop
git pull will performed merge, should I use fetch and then merge with some option parameter ?
Do you have some other suggestions ?