Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 792
JohnNY Avatar asked Feb 28 '13 12:02

JohnNY


People also ask

Can branches have branches in git?

The git branch command lets you create, list, rename, and delete branches. It doesn't let you switch between branches or put a forked history back together again. For this reason, git branch is tightly integrated with the git checkout and git merge commands.

How do I pull data from a GitHub branch?

PULL request for a specific branch on GitHub You can move to your repository in GitHub and see that there is a new branch. Alternatively, you can do git pull-request in the command line and complete the PULL Request to GitHub, where it will force push your current branch to a remote repository.

Does git pull pull from all branches?

git pull fetches updates for all local branches, which track remote branches, and then merges the current branch.


1 Answers

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)

like image 188
VonC Avatar answered Sep 30 '22 03:09

VonC