title: Create release subbranch
body: <p><strong>[simplified question (hopefully)]</strong></p>
  <p>I have a master branch with files A, B, C, and D.
  I want to have the following branching structure</p>
  <pre><code>master
  |- branch1
  |- branch2
  |- branch3
  </code></pre>
  <p>where</p>
  <ul>
  <li>master contains file A</li>
  <li>branch1 contains files A and B</li>
  <li>branch2 contains files A and C</li>
  <li>branch3 contains files A and D</li>
  </ul>
  <p>If I branch branch1, branch2, and branch3 from master, all branches will contain A, B, C, and D.
  I could then
  remove C and D from branch1,
  remove B and D from branch2, and
  remove B and C from branch3.
  Then I could merge branch1, branch2, and branch3 into master.
  That should work, right?
  However, I have to delete B, C, and D each two times from different branches: can this be optimized so that I do not need to delete a file multiple times?</p>
  <p><strong>[version1]</strong></p>
  <p>I have a java/git project and, as of now, I only have a master branch.
  I would now like to set up a release branch in a suitable way now by excluding parts of the code (some files but also some methods from certain files).</p>
  <p>I could</p>
  <ul>
  <li>create a development branch from the master branch,</li>
  <li>create a release branch from the development branch, and</li>
  <li>delete elements from the release branch as needed.</li>
  </ul>
  <p>But I imagine that merging changes on the development branch later into the release branch would be problematic when there are delete/modify conflicts.</p>
  <p>I would follow a tutorial on that but did not find one.
  Any ideas on how to do this in a reasonable and simple (I am not much of git poweruser) way?</p>
  <p>[more info]</p>
  <p>Basically, my code can be understood as a core part on which multiple modules operate.
  Ideally, I should have created a branch for the core and one branch for each module.
  However, now with the release problem, I also would need subbranches that hide parts of each branch.</p>
  <pre><code>src/core/Main.java
  src/core/Helper.java
  src/modA/FeatureA.java
  src/modA/ExperimentalFeatureA.java
  src/modB/FeatureB.java
  src/modB/ExperimentalFeatureB.java
  </code></pre>
  <p><strong>[version2]</strong></p>
  <p>I believe that I may want to have a structure like below where the branches core_dev, moduleA_dev, and moduleB_dev contain additional stuff not to be merged into core, moduleA, and moduleB.
  Then I would need to check what to merge every time when merging a *_dev branch.
  But, how to set this up? I guess the following would work with the extra effort to delete the same things in different branches in step 2.</p>
  <ul>
  <li>branch as described below but omit moduleA, moduleA_dev, moduleB, and moduleB_dev branches.</li>
  <li>delete additional material in core</li>
  <li>merge core into development</li>
  <li>merge development into release</li>
  <li>merge release into master</li>
  <li>branch moduleA from core, branch moduleA_dev from moduleA</li>
  <li>branch moduleB from core, branch moduleB_dev from moduleB</li>
  <li>somehow! merge core_dev into moduleA_dev and moduleB_dev without changing moduleA and moduleB</li>
  </ul>
  <p>But does it make sense to do this differently?</p>
  <pre><code>master
  |- release
     |- development
        |- core
            + src/core/Main.java
           |- core_dev
               + src/core/Helper.java
           |- moduleA
               + src/modA/FeatureA.java
              |- moduleA_dev
                  + src/modA/ExperimentalFeatureA.java
           |- moduleB
               + src/modB/FeatureB.java
              |- moduleB_dev
                  + src/modB/ExperimentalFeatureB.java
  </code></pre>