Home:ALL Converter>Merge a branch into the folder of another branch

Merge a branch into the folder of another branch

Ask Time:2019-07-03T23:28:45         Author:Alan

Json Formatter

I have a branch A with a folder named foo. Another branch named B has only the content of the folder foo. Is it possible to merge the branch B into the folder foo of branch A?

The branch A contains for example

foo/
    hello_world.c
goo/
    AliceAndTom.c

The branch B contains only the content of the folder foo/

./
    hello_world.c
    hello_world.h

The result I want in the branch A after merging branch B:

foo/
    hello_world.c
    hello_world.h
goo/
    AliceAndTom.c

Edit: branch B was created using git command git filter-branch --subdirectory-filter dir/to/filter -- subdir_branch

Author:Alan,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/56873506/merge-a-branch-into-the-folder-of-another-branch
yy