Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to update topic branch with upstream changes on master?
    text
    copied!<p>I start some work on a topic branch</p> <pre><code> •-•-• &lt; topic / •-• &lt; master </code></pre> <p>I push the topic branch</p> <pre><code>$ git push origin topic </code></pre> <p>Someone else pushes changes to master</p> <pre><code> •-•-• &lt; origin/topic / •-•-•—• &lt; origin/master </code></pre> <h3>How do I update my local master and rebase my topic?</h3> <p>History should look like this</p> <pre><code> •-•-• &lt; topic / •-•-•—• &lt; master </code></pre> <h3>What I am trying</h3> <pre class="lang-shell prettyprint-override"><code>; update master $ git checkout master $ git fetch origin $ git merge --ff-only origin/master ; rebase topic $ git checkout topic $ git rebase master </code></pre> <h3>The problem</h3> <p>All of my commits on <code>topic</code> are seen as uncommitted. So when I try <code>git push origin topic</code>, I get</p> <pre class="lang-none prettyprint-override"><code> ! [rejected] topic -&gt; topic (non-fast-forward) error: failed to push some refs to '/path/to/repo.git' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Merge the remote changes (e.g. 'git pull') hint: before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details. </code></pre> <h3>The solution?</h3> <p>Please note, I do <strong>not</strong> want to merge my <code>topic</code> branch with <code>master</code>. I'd simply like to get my local repo updated without having to merge branches unnecessarily.</p>
 

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