Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>But I get an error "! [rejected]" and something about "non fast forward"</p> </blockquote> <p>That's because Git can't merge the changes from the branches into your current master. Let's say you've checked out branch <code>master</code>, and you want to merge in the remote branch <code>other-branch</code>. When you do this:</p> <pre><code>$ git pull origin other-branch </code></pre> <p>Git is basically doing this:</p> <pre><code>$ git fetch origin other-branch &amp;&amp; git merge other-branch </code></pre> <p>That is, a <code>pull</code> is just a <code>fetch</code> followed by a <code>merge</code>. However, when <code>pull</code>-ing, Git will <em>only</em> merge <code>other-branch</code> <em>if</em> it can perform a <em>fast-forward</em> merge. A <em>fast-forward</em> merge is a merge in which the head of the branch you are trying to merge into is a <em>direct descendent</em> of the head of the branch you want to merge. For example, if you have this history tree, then merging <code>other-branch</code> would result in a fast-forward merge:</p> <pre><code>O-O-O-O-O-O ^ ^ master other-branch </code></pre> <p>However, this would <em>not</em> be a fast-forward merge:</p> <pre><code> v master O-O-O \ \-O-O-O-O ^ other-branch </code></pre> <p>To solve your problem, first <em>fetch</em> the remote branch:</p> <pre><code>$ git fetch origin other-branch </code></pre> <p>Then merge it into your current branch (I'll assume that's <code>master</code>), and fix any merge conflicts:</p> <pre><code>$ git merge origin/other-branch # Fix merge conflicts, if they occur # Add merge conflict fixes $ git commit # And commit the merge! </code></pre>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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