Note that there are some explanatory texts on larger screens.

plurals
  1. POGithub rebase upstream/master with origin/master
    text
    copied!<p>I'm rather new to github social coding and are having trouble following github guidelines. I'll try to describe what happened and what I'm trying to achieve - hoping that more experienced git wizards can help me figure out the arcade commands needed to get there.</p> <ul> <li><strong>Original project</strong>: <a href="https://github.com/phatboyg/MassTransit" rel="nofollow noreferrer">https://github.com/phatboyg/MassTransit</a></li> <li><strong>My fork</strong>: <a href="https://github.com/davidcie/MassTransit" rel="nofollow noreferrer">https://github.com/davidcie/MassTransit</a></li> <li><strong>Platform</strong>: Windows, with Github for Windows + its PowerShell</li> </ul> <h3>What happened</h3> <ol> <li>I forked MassTransit back in <strong>July 2012</strong>. Its <em>master</em> branch back then was at version v2.1.1, with last commit on <strong>Mar 29, 2012</strong>.</li> <li>Following github advice, I then started coding some changes on a topic branch.</li> <li>A few commits later, when the feature was finished, I merged my topic branch into my clone's local <em>master</em> and then pushed that to github.</li> <li>Ever since <strong>Mar 29, 2012</strong>, MassTransit was being developed on its <em>develop</em> branch. All of those changes, making up v2.6.0, were merged with its <em>master</em> recently.</li> </ol> <h3>What I'd like to do</h3> <p>I'd like to get all changes that were merged into <em>upstream/master</em>. Preferrably as their respective commits, not one massive commit of hundreds of files. Because I was doing development on the <em>former</em> <em>upstream/master</em> (dated Mar 29, 2012), I guess would effectively need to "insert" some commits in between the last <em>upstream/master</em> change of Mar 29 and my first commit of Aug 8, and then on top of that add those that happened later. <strong>How do I do that?</strong></p> <p>(I'd also like not to destroy my commits/fork in the process ;-)</p> <h3>What I tried</h3> <pre><code>git checkout master git remote add upstream git://github.com/phatboyg/MassTransit.git git rebase upstream/master git push </code></pre> <p>However, it would not let me then do <code>git push</code>, complaining that my local tip was 10 commits behind the origin (possibly the commits I made on my topic branch and later merged into <em>origin/master</em>?).</p> <h3>Recommendations?</h3> <p>It seems that I may have been bitten by recommendations. Eg. perhaps it would be better to create a separate branch, eg. <em>local-master</em>, and treat that as... well, my own master. Then <em>master</em> would be there only for keeping in touch with <em>upstream/master</em>, and I would occasionally rebase <em>origin/master</em> with <em>upstream/master</em> and merge with <em>origin/local-master</em>...</p> <p>How do you guys manage your forks?</p> <h3>Other questions</h3> <p>I've been unable to find a way to visualize branch history, what branch was merged with another and when, etc. Github for Windows only shows a flat history for the currently selected branch (sad face here). The website does have <em>some</em> visualizations for the network (<a href="https://github.com/phatboyg/MassTransit/network" rel="nofollow noreferrer">here is one for MassTransit</a>), but this feels a lot less informative than say the <a href="http://tortoisehg.bitbucket.io/screenshots.html#history" rel="nofollow noreferrer">graphs in TortoiseHg</a>. Am I missing something obvious? Does everyone else just remember what was merged with what and when?</p> <h3><em>Edit (31st August)</em></h3> <p>I'm sharing a <a href="http://imageshack.us/photo/my-images/717/gitproblem.png/" rel="nofollow noreferrer">poor-man's visualization</a> to help explain what happened. </p> <ol> <li>I forked when <strong>C1</strong> was latest on <em>upstream/master</em>.</li> <li>I then developed on my <em>origin/feature-1</em>.</li> <li>One the feature was complete, I merged it with my <em>origin/master</em>. </li> <li>When <em>upstream/mega-feature</em> was completed, it was merged with <em>upstream/master</em>, effectively historically copying <strong>C2</strong> and <strong>C3</strong> to <em>upstream/master</em>. (Or perhaps <em>upstream/master</em> was <strong>rebased</strong> with <em>upstream/mega-feature</em>?)</li> <li>I would now like to copy <strong>C2</strong>, <strong>C3</strong> and <strong>C4</strong> to my <em>origin/master</em>.</li> </ol>
 

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