Can a GIT branch have a subset of data?

I am trying to find out if a GIT branch can have a subset of the project data like the example below.

I am working on a java, spring, maven project and my source is at

  • git - How to checkout all changed files between two commits
  • Separating CodeIgniter config file Git for publishing publically
  • git pull is not working on msysgit client?
  • Git archive of repository with uncommitted changes
  • GitLab SSL handshake error when performing a Git Pull/Clone Using TortoiseGit and Ansible
  • How do I stop Github changing my project name?
  • src/main/java
    

    and my JSP pages are at:

    src/main/webapp
    

    we are thinking of outsource the JSP pages to a diff group but we don’t want them changing the java code so we are trying to think if we can map a branch with just

    src/main/webapp
    

    and then merge it back in

  • Git SVN, Unable to determine upstream SVN information from working tree history after git rebase
  • Is it possible to clone git config from remote location?
  • Pod from github not working
  • How to create branch and push to server
  • How can I checkout to a remote tracking branch in git?
  • How to list all the branches of git repository, the latest updates on each, and state of local branches?
  • One Solution collect form web for “Can a GIT branch have a subset of data?”

    One way would be to export the history of that webapp directory an an independent git repo, used within the current (parent) repo as a submodule.
    That way, you are sure the external contributor doesn’t modify any source except the ones you want.

    The other (simpler) way is to create a branch dedicated for the other group of contributors, and accept merges only through pull request (that you would reject if any file outside of webapp is modified)

    Git Baby is a git and github fan, let's start git clone.