I have two Git repos, foo/master and bar/master:
In foo:
code_root
->dirA
->dirB
-> *some files*
In bar:
So, you are saying the files are essentially the same in both in foo & bar, just that the ones in foo are newer than those in bar:
If yes, then you can just take a diff:
diff -b /path_to/foo/dirA/dirB/ /path_to/bar/ > diff.patch
and then apply the patch onto bar:
cd bar
patch -p1 < diff.patch
Update: As per OPs updated, he's looking to maintain commit history, above won't work in that case.