How to tell git to ignore certain folders and files during a subtree merge?
===

I have master branch with the following directory structure

    templates/something.lib
    templates/libs/1.lib

And I also have a templates_master branch with the following files (right in the root)

    a.html
    b.html

Then I go to master and load the templates into master templates folder

    git read-tree --prefix=templates/ -u templates_master

which results into this master structure now

    templates/something.lib
    templates/libs/1.lib
    templates/a.html
    templates/b.html


Then I stay on master and introduce some changes into templates/a.html making several commits. Now I want this modified templates/a.html to go back into its original branch. I switch to templates_master branch and run this command

    git merge -s subtree master

However this command not only copies the master:templates/a.html to templates_master:a.html but also copies those libs files so basically now my templates_master branch has everything that the original master templates/ had. Is it possible to tell git to keep certain files and folders in the master branch only or is this logic hardcoded on the git level, i.e. during subdirectory merge it uses treeish pointing to templates/ and everything inside templates/ is and can only be the child of templates/ ?