Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>So you have committed your local changes to your local repository. Then in order to get remote changes to your local repository without making changes to your local files, you can use <code>git fetch</code>. Actually <code>git pull</code> is a two step operation: a non-destructive <code>git fetch</code> followed by a <code>git merge</code>. See <a href="https://stackoverflow.com/questions/292357/whats-the-difference-between-git-pull-and-git-fetch">What is the difference between &#39;git pull&#39; and &#39;git fetch&#39;?</a> for more discussion. </p> <p>Detailed example:</p> <p>Suppose your repository is like this (you've made changes <code>test2</code>:</p> <pre><code>* ed0bcb2 - (HEAD, master) test2 * 4942854 - (origin/master, origin/HEAD) first </code></pre> <p>And the <code>origin</code> repository is like this (someone else has committed <code>test1</code>):</p> <pre><code>* 5437ca5 - (HEAD, master) test1 * 4942854 - first </code></pre> <p>At this point of time, git will complain and ask you to pull first if you try to push your <code>test2</code> to remote repository. If you want to see what test1 is without modifying your local repository, run this:</p> <pre><code>$ git fetch </code></pre> <p>Your result local repository would be like this:</p> <pre><code>* ed0bcb2 - (HEAD, master) test2 | * 5437ca5 - (origin/master, origin/HEAD) test1 |/ * 4942854 - first </code></pre> <p>Now you have the remote changes in another branch, and you keep your local files intact. </p> <p>Then what's next? You can do a <code>git merge</code>, which will be the same effect as <code>git pull</code> (when combined with the previous <code>git fetch</code>), or, as I would prefer, do a <code>git rebase origin/master</code> to apply your change on top of <code>origin/master</code>, which gives you a cleaner history.</p>
    singulars
    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. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    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