title: Git merge hotfix branch into feature branch
body: <p>Let’s say we have the following situation in Git:</p>
  
  <ol>
  <li><p>A created repository:</p>
  
  <pre><code>mkdir GitTest2
  cd GitTest2
  git init
  </code></pre></li>
  <li><p>Some modifications in the master take place and get committed:</p>
  
  <pre><code>echo "On Master" &gt; file
  git commit -a -m "Initial commit"
  </code></pre></li>
  <li><p>Feature1 branched off master and some work is done:</p>
  
  <pre><code>git branch feature1
  git checkout feature1
  echo "Feature1" &gt; featureFile
  git commit -a -m "Commit for feature1"
  </code></pre></li>
  <li><p>Meanwhile, a bug is discovered in the master-code and a hotfix-branch is established:</p>
  
  <pre><code>git checkout master
  git branch hotfix1
  git checkout hotfix1
  </code></pre></li>
  <li><p>The bug is fixed in the hotfix branch and merged back into the master (perhaps after a pull request/code review):</p>
  
  <pre><code>echo "Bugfix" &gt; bugfixFile
  git commit -a -m "Bugfix Commit"
  git checkout master
  git merge --no-ff hotfix1
  </code></pre></li>
  <li><p>Development on feature1 continues:</p>
  
  <pre><code>git checkout feature1
  </code></pre></li>
  </ol>
  
  <p>Say I need the hotfix in my feature branch, maybe because the bug also occurs there. How can I achieve this without duplicating the commits into my feature branch?</p>
  
  <p>I want to prevent to get two new commits on my feature branch which have no relation to the feature implementation. This especially seems important for me if I use pull requests: All these commits will also be included in the pull request and have to be reviewed although this has already been done (as the hotfix is already in the master).</p>
  
  <p>I can not do a <code>git merge master --ff-only</code>: "fatal: Not possible to fast-forward, aborting.", but I am not sure if this helped me.</p>