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
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.
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.
git pull fetches updates for all local branches, which track remote branches, and then merges the current branch.
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With