GIT: How to extract a specific folder from a git repository branch, including the folder's related git history only
NOTE: If you want to keep the history for a specific folder in the master
branch, just skip steps in lines 3,4,5,6,7
git clone <git-repository-url>
cd <git-repository-dir>
git checkout <branch-name> # line 3; Checkout the branch of interest
git merge --strategy=ours master # line 4; keep the content of this branch only and record a merge
git checkout master # line 5; Go back to the master branch