I think this is similar to what I gave to a post a couple of days ago. You 
might try the following on your local machine. I will show the commands 
that I would enter in a Linux BASH shell. I don't do Windows or MacOSX, but 
you seem to be on Ubuntu.. First, I would clone the B repository into a 
local working directory. I would then clone A into a different local 
working directory. Of course, double check the results of all the commands 
after doing them and stop if something goes wrong. I have not redone them 
myself to remind myself exactly what to do. It's why I'm showing doing this 
into new subdirectories. Make sure the new B working directory is good 
before pushing to github!

cd ~/some-subdir #go someplace to make the new A and B working directories
git clone git://github.com/lei/A.git
git clone git://github.com/lei/B.git
cd A
git checkout -b kvm #make a new branch in A
mkdir kvm #make a kvm directory for A
git mv * kvm #move everything into it
git commit -m 'move to kvm subdirectory for copy to B' #Needed???
cd ../B #go to the B subdirectory
git remote add temp ../A/.git #make A's .git directory a remote here
git merge --no-commit temp kvm #merge in A's kvm branch
git commit -m 'Copy all of kvm from project A'
git remote rm temp #remove that temp repository
git push #update github.

I think that is fairly close to what you may need. Perhaps one of the true 
"old, wise ones" (I'm an "old, not-so-wise one") will also give you some 

On Monday, December 10, 2012 2:35:58 AM UTC-6, lei yang wrote:
> Hi experts, 
> I have two tree A and B, 
> A: git://github.com/lei/A.git 
> B: git://github.com/lei/B.git 
> B is like 
> [lyang0@ubuntu B]$ ls 
> benchmark  box-opening  kvm 
> I want merge A tree to B, 
> 1) put A's content to the "kvm" directory of B 
> 2)I want to keep all the A's commit log(history) into B's tree 
> can you give me some instruction?  Thanks 
> Lei 


Reply via email to