OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Branches out of sync because of git cherry pick - how to resync

  • Thread starter Thread starter Manish Paul
  • Start date Start date
M

Manish Paul

Guest
So I started working on a project with two branches-


  • master


  • stage.

The strategy has been to cherry-pick commits from stage to master and multiple teams do the same everyday.

Now this has caused master and stage to be totally out of sync with a difference of 30,000+ commits (since cherry-pick creates a new sha for every commit). If we try to sync the branches, these are shown as conflicts and new files.

While both the branches more or less have the same code, is there any solution to the below-


  • Tell GIT that the two branches are the same now and to ignore the past differences? This way, we can start merging feature branches into stage and master instead of doing cherry-picks.


  • Somehow sync the two branches without recreating them?


  • Point both the branches to the same HEAD so that the branches are now considered the same?


  • Any alternate strategy to fix this mess?

Any pointers will be greatly appreciated!
<p>So I started working on a project with two branches-</p>
<ul>
<li><p><code>master</code></p>
</li>
<li><p><code>stage</code>.</p>
</li>
</ul>
<p>The strategy has been to <code>cherry-pick</code> commits from <code>stage</code> to <code>master</code> and multiple teams do the same everyday.</p>
<p>Now this has caused <code>master</code> and <code>stage</code> to be totally out of sync with a difference of 30,000+ commits (since <code>cherry-pick</code> creates a new <code>sha</code> for every commit). If we try to sync the branches, these are shown as conflicts and new files.</p>
<p>While both the branches more or less have the same code, is there any solution to the below-</p>
<ul>
<li><p>Tell GIT that the two branches are the same now and to <strong>ignore the past differences</strong>? This way, we can start merging feature branches into <code>stage</code> and <code>master</code> instead of doing <code>cherry-picks</code>.</p>
</li>
<li><p>Somehow sync the two branches without recreating them?</p>
</li>
<li><p>Point both the branches to the same <code>HEAD</code> so that the branches are now considered the same?</p>
</li>
<li><p>Any alternate strategy to fix this mess?</p>
</li>
</ul>
<p>Any pointers will be greatly appreciated!</p>
Continue reading...
 

Latest posts

A
Replies
0
Views
1
Alfredo Augusto Petri
A
Top