Init a repo:
git init .
Make initial commit - it's required to add a subtree:
echo "git repo with subtrees" > README.md
git add README.md
git commit -m "Initial commit"
Add git repo 'A' with it's history log:
git subtree add --prefix=A https://github.com/A/A.git master
Add git repo 'B' with all commits squashed to one:
git subtree add --squash --prefix=B https://github.com/B/B.git master
Now we should have:
> ls
README.md
A
B
> git status
On branch master
nothing to commit, working tree clean
Pull changes from tree's remote:
git subtree pull --prefix=A https://github.com/A/A.git master
You are all set!