Note that there are some explanatory texts on larger screens.

plurals
  1. POMerge conflicts when using squash merge
    primarykey
    data
    text
    <p>My team and I have been using git for about a year--none of us had any prior experience with git or any other version control. We do most of our work in dev, and when we're ready, we make a release branch, make any changes if needed, then merge the release branch into master. When merging our release branches into master, we've been doing a squash merge to keep the commit history clean. We've read lots of guides/tutorials/how-tos and everyone one of them says something different, but this is what we decided to do.</p> <p>What I have noticed is whenever we merge our release branch into master, we always get merge conflicts. Not with every file, but with about 15% of them or so. Most of these don't seem like they should be conflicts, but they show up as one. Here's an example:</p> <p><strong>Master branch before merge:</strong></p> <pre><code>&lt;div style="float:right"&gt; &lt;strong&gt;Select Report: &lt;/strong&gt; &lt;select name="report" id="report"&gt; &lt;option value=""&gt;-- SELECT REPORT --&lt;/option&gt; &lt;optgroup label="General"&gt; &lt;option value="aganalysis_stats"&lt;?php if($report == 'aganalysis_stats') echo " selected"; ?&gt;&gt;AgAnalysis Stats&lt;/option&gt; &lt;/optgroup&gt; &lt;optgroup label="LSPs"&gt; &lt;option value="lsps_pending_approval_for_current_quarter"&lt;?php if($report == 'lsps_pending_approval_for_current_quarter') echo " selected"; ?&gt;&gt;LSPs Pending Approval for Current Quarter&lt;/option&gt; &lt;option value="members_requiring_lsps"&lt;?php if($report == 'members_requiring_lsps') echo " selected"; ?&gt;&gt;Members Requiring LSPs&lt;/option&gt; &lt;option value="missing_lsps_for_current_quarter"&lt;?php if($report == 'missing_lsps_for_current_quarter') echo " selected"; ?&gt;&gt;Missing LSPs for Current Quarter&lt;/option&gt; &lt;/optgroup&gt; &lt;optgroup label="UCCs"&gt; &lt;option value="uccs_by_branch"&lt;?php if($report == 'uccs_by_branch') echo " selected"; ?&gt;&gt;UCCs by Branch&lt;/option&gt; &lt;option value="uccs_eligible_for_renewal"&lt;?php if($report == 'uccs_eligible_for_renewal') echo " selected"; ?&gt;&gt;UCCs Eligible for Renewal&lt;/option&gt; &lt;option value="uccs_expired"&lt;?php if($report == 'uccs_expired') echo " selected"; ?&gt;&gt;Expired UCCs&lt;/option&gt; &lt;/optgroup&gt; &lt;/select&gt; &lt;/div&gt; </code></pre> <p><strong>Master branch after merge:</strong></p> <pre><code>&lt;div style="float:right"&gt; &lt;strong&gt;Select Report: &lt;/strong&gt; &lt;select name="report" id="report"&gt; &lt;option value=""&gt;-- SELECT REPORT --&lt;/option&gt; &lt;optgroup label="Appraisal Requests"&gt; &lt;option value="appraisal_request_stats"&gt;Appraisal Request Stats&lt;/option&gt; &lt;/optgroup&gt; &lt;optgroup label="General"&gt; &lt;option value="aganalysis_stats"&gt;AgAnalysis Stats&lt;/option&gt; &lt;/optgroup&gt; &lt;optgroup label="LSPs"&gt; &lt;option value="lsps_pending_approval_for_current_quarter"&gt;LSPs Pending Approval for Current Quarter&lt;/option&gt; &lt;option value="members_requiring_lsps"&gt;Members Requiring LSPs&lt;/option&gt; &lt;option value="missing_lsps_for_current_quarter"&gt;Missing LSPs for Current Quarter&lt;/option&gt; &lt;/optgroup&gt; &lt;optgroup label="UCCs"&gt; &lt;&lt;&lt;&lt;&lt;&lt;&lt; HEAD &lt;option value="uccs_by_branch"&lt;?php if($report == 'uccs_by_branch') echo " selected"; ?&gt;&gt;UCCs by Branch&lt;/option&gt; &lt;option value="uccs_eligible_for_renewal"&lt;?php if($report == 'uccs_eligible_for_renewal') echo " selected"; ?&gt;&gt;UCCs Eligible for Renewal&lt;/option&gt; &lt;option value="uccs_expired"&lt;?php if($report == 'uccs_expired') echo " selected"; ?&gt;&gt;Expired UCCs&lt;/option&gt; ======= &lt;option value="uccs_by_branch"&gt;UCCs by Branch&lt;/option&gt; &lt;option value="uccs_eligible_for_renewal"&gt;UCCs Eligible for Renewal&lt;/option&gt; &lt;option value="uccs_expired"&gt;Expired UCCs&lt;/option&gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt; refs/remotes/origin/dev &lt;/optgroup&gt; &lt;/select&gt; &lt;/div&gt; </code></pre> <p>As you can see, I made the exact same changes on both "LSPs" and "UCCs" optgroups. But, I only get a merge conflict in the "UCCs" optgroup. Why am I getting this merge conflict? Am I merging incorrectly? Should I not use a squash merge when merging branches into master? I've read so many things about rebasing, squash commits, no fast-forward, etc., I don't know what's right or wrong anymore.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload