Git Merge some folder

Viewed 6393

I have two git local branches named A and B (which points to the remote branches origin/A and origin/B.

Branch - A:

Folder-1
   File-11
   File-12
Folder-2
   File-21
   File-22

Branch - B:
Folder-2
   File-22
   File-23
Folder-3
   File-31
   File-32

I want to merge branch B with branch A.

git checkout A
git merge B

The final out come should be like this.

Branch - A:
Folder-1
   File-11
   File-12
Folder-2
   File-21
   File-22 (Branch -A file).
Folder-3
   File-31
   File-32

Merge Folder-3 alone, keep Folder-1 and Folder-2 from branch A.

The basic requirement is, I should not loss logs (and commits) history.

How to do it?

Thanks in advance.

3 Answers
Related