title: How should gitflow hotfixes work?
body: <p>We use Gitflow for our web builds, and I have a question about how <code>hotfixes</code> are supposed to work. But first I should explain that we don't <em>quite</em> use the normal Gitflow workflow.</p>
  
  <p>I understand that usually you would branch your <code>features</code>, they would merge into <code>develop</code> when finished, you would create your <code>release</code>, <code>release</code> gets merged into <code>master</code> and you deploy that, as an actual "versioned release".</p>
  
  <p>However, as this is client work, we don't do "releases", instead features are deployed as and when they are required, so changes from our <code>feature</code> branches are merged into <code>master</code> on an ad-hoc basis.</p>
  
  <p>This did cause problems as the <code>feature</code> branches were branched from <code>develop</code> which was way ahead of <code>master</code>; merging these <code>feature</code> branches into <code>master</code> would merge other changes into <code>master</code> (changes that were present in <code>develop</code> at the time the <code>feature</code> was branched that weren't yet in <code>master</code>). We were aware that this is not how Gitflow is designed, but we needed a branching model of some sort, so we (sort of) solved this by cherrypicking commits instead of merging branches.</p>
  
  <p>So, I understand these issues, and I don't believe they're contributing to the issue I have now, but just in case, this is how we use it. However my question is:</p>
  
  <p><strong>How are <code>hotfixes</code> <em>supposed</em> to merge in?</strong></p>
  
  <p>In my head, the scenario is:</p>
  
  <ul>
  <li><code>master</code> is "production"</li>
  <li><code>develop</code> is ahead of <code>master</code></li>
  </ul>
  
  <p>You then want to patch an immediate issue with a <code>hotfix</code> branch. In Gitflow, this branches from <code>master</code>, and when you finish the <code>hotfix</code>, this gets merged into <code>master</code> <strong>and</strong> <code>develop</code></p>
  
  <p>But how does this not cause massive problems?</p>
  
  <p>Recently, I tried to create a <code>hotfix</code> to change a single line of copy in one file. I finished the <code>hotfix</code>, and the change merged into <code>master</code> with no problems, but when it tired to merge into <code>develop</code>, it created an enormous 35 file diff with several merge conflicts in files I hadn't touched, due to the disparity between <code>develop</code> and <code>master</code>.</p>
  
  <p>I understand that this is because you are merging the <code>hotfix</code> <em>branch</em>, which was itself branched from <code>master</code>, into <code>develop</code>, not specifically the <em>change</em> or single <em>commit</em>, so I understand <em>why</em> there was the massive merge commit/conflict.</p>
  
  <p>However, what I <em>don't</em> understand is, with this in mind, how <code>hotfixes</code> work at all "in the real world", considering they are branched from <code>master</code> and then merged into <code>develop</code>, which is, by design, way ahead of <code>master</code>. This is why I don't think the way we're using Gitflow is the issue, because <code>develop</code> would be ahead of <code>master</code> regardless of our non-standard deployment process - I can't see why this doesn't cause huge headaches regardless of the project or exact workflow.</p>
  
  <p>What doesn't seem to make sense to me is that your <code>hotfix</code> could be something as simple as changing a <code>true</code> to a <code>false</code> or changing an email address, whatever, but to get it into <code>master</code>, you may have to wrestle with an enormous set of merge conflicts. Is this just standard behaviour? Is this just how <code>hotfixes</code> work, and if you have to sit and sort out a massive merge conflict, then so be it? Would it not be easier to just cheerypick a commit? It just seems like there is such massive scope to introduce an error for what could be such a tiny change - you're dealing with two branches that are, perhaps, several months and hundreds of commits away from each other.</p>
  
  <p>I may just be misunderstanding the process of <code>hotfixes</code>, but if I am, I'm not sure which bit.</p>