<html><body><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000"><div>Thanks Paul, Martin and Pavol.<br></div><div><br></div><div>I hadn't heard of the command cherry-pick - very useful. All is fixed now.</div><div><br></div><div>Thanks,<br>Michelle</div><div><br></div><hr id="zwchr"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"phantomjinx" <p.g.richardson@phantomjinx.co.uk><br><b>To: </b>"Michelle Murray" <mmurray@redhat.com><br><b>Cc: </b>jbosstools-dev@lists.jboss.org<br><b>Sent: </b>Wednesday, 24 July, 2013 8:03:43 PM<br><b>Subject: </b>Re: [jbosstools-dev] Help: Applying PRs to two branches<br><div><br></div>On 07/24/2013 09:16 AM, Michelle Murray wrote:<br>> Can anyone instruct me how to apply a PR to two branches?<br>> <br>> So I made a PR with some changes. I applied that to master branch. All good.<br>> <br>> But I want to also apply the changes in the PR to 4.1.x. But master and 4.1.x are out of sync. When<br>> I try to apply my PR, github wants to apply all of the previous changes to make the branches the<br>> same before applying my changes. I only want to apply my changes.<br>> <br>> If you can follow what I'm saying, can you advice what do I need to do? (Or where I've gone wrong!)<br>> <br>> Thanks,<br>> Michelle<br><div><br></div>Hi Michelle,<br><div><br></div>Depending on the number of the commits the PR represents, you could cherry-pick or rebase the PR<br>commits from master onto your 4.1.x branch in your local git repository.<br><div><br></div>If there is only a couple of commits in the PR, eg.<br><div><br></div><master branch> -- A -- B<br><div><br></div><4.1.x branch><br><div><br></div>git checkout 4.1.x<br>git cherry-pick A<br>git cherry-pick B<br><div><br></div>will result in:<br><div><br></div>master -- A -- B<br><div><br></div>4.1.x -- A' -- B'<br><div><br></div><br>Should there be many commits in the PR then use git rebase, eg.<br><div><br></div>git rebase --onto 4.1.x A master<br><div><br></div>This will essentially take all the commits from A -> the head of master and replay them on top of<br>4.1.x. Its a more automated process than cherry-picking but will end with the same result. If you<br>run into problems then simply 'git rebase --abort' to reset the branch.<br><div><br></div>Once you have your local repo correct, simply push the new 4.1.x branch to github.<br><div><br></div>Regards<br><div><br></div>PGR<br><div><br></div>-- <br>Paul Richardson<br><div><br></div> * p.g.richardson@phantomjinx.co.uk<br> * p.g.richardson@redhat.com<br> * pgrichardson@linux.com<br><div><br></div>"I know exactly who reads the papers ...<br><div><br></div> * The Daily Mirror is read by people who think they run the country.<br> * The Guardian is read by people who think they ought to run the country.<br> * The Times is read by people who do actually run the country.<br> * The Daily Mail is read by the wives of the people who run the country.<br> * The Financial Times is read by the people who own the country.<br> * The Morning Star is read by the people who think the country ought to be run by another country.<br> * The Daily Telegraph is read by the people who think it is."<br><div><br></div>Jim Hacker, Yes Minister<br><div><br></div></blockquote><div><br></div></div></body></html>