title: git doesn't seem to pull all updates - HEAD and origin/HEAD in different positions
body: <p>I have ended up with a git repository in a state I don't know how to handle, and I need some help with understanding a) what's going on, how and why the repository is in this state, and b) how I should react to it. Basically, when pulling from the remote, I end up ahead of the remote, even if I reset all changes and try again.</p>
  
  <p>This is what I've done:</p>
  
  <p>I have forked a git repository, cloned the upstream version (which I don't have write access to) and then added my own fork to the list of remotes, so that <code>git remote -v</code> shows the following:</p>
  
  <pre><code>$ git remote -v
  mine    git@github.com:tlycken/julia.git (fetch)
  mine    git@github.com:tlycken/julia.git (push)
  origin  git://github.com/JuliaLang/julia.git (fetch)
  origin  git://github.com/JuliaLang/julia.git (push)
  </code></pre>
  
  <p>I now want to make sure that my local version is up to date with everything in the upstream repo, so I run</p>
  
  <pre><code>$ git pull origin master
  From git://github.com/JuliaLang/julia
   * branch            master     -&gt; FETCH_HEAD
  Already up-to-date.
  tlycken$ git status
  # On branch master
  # Your branch is ahead of 'origin/master' by 4 commits.
  #   (use "git push" to publish your local commits)
  #
  nothing to commit, working directory clean
  </code></pre>
  
  <p>This confuses me. Why is my branch ahead of origin master? I haven't changed anything.</p>
  
  <p>To see if I could do something about it, I ran <code>git lg</code> (an alias for <code>git log --graph</code> with some prettyprint). The top of the output looks like this:</p>
  
  <pre><code>*   6912a42 - (HEAD, mine/master, master) Merge pull request #3052 from daviddelaat/linalgnumber (2013-05-10 11:23:09 -0700) &lt;Viral B. Shah&gt;
  |\  
  | * 8116d51 - Use Number instead of Integer in some linalg operations (2013-05-10 19:12:45 +0200) &lt;David de Laat&gt;
  * | 6cc1532 - Update .travis.yml configuration in the manual. (2013-05-10 21:41:59 +0530) &lt;Viral B. Shah&gt;
  * | fa1e3fe - Update logdet. Close #3070. (2013-05-10 19:35:37 +0530) &lt;Viral B. Shah&gt;
  * |   a182f7f - (origin/master, origin/HEAD, mine/contrib-base) Merge branch 'master' of github.com:JuliaLang/julia (2013-05-10 03:10:38 -0400) &lt;Jeff Bezanson&gt;
  </code></pre>
  
  <p>Apparently, the HEAD's are in different positions. To make sure that I get the correct code in my local repository before I start branching out, I did <code>git reset --hard origin/HEAD</code> to remove anything I was ahead, and then <code>git pull origin master</code> to make sure I was up to date (i.e. didn't reset too far or something):</p>
  
  <pre><code>$ git pull origin master
  From git://github.com/JuliaLang/julia
   * branch            master     -&gt; FETCH_HEAD
  Updating a182f7f..6912a42
  Fast-forward
   base/linalg/dense.jl         |  2 +-
   base/linalg/factorization.jl | 44 ++++++++++++++++++++++----------------------
   doc/manual/packages.rst      |  3 +--
   3 files changed, 24 insertions(+), 25 deletions(-)
  $ git status
  # On branch master
  # Your branch is ahead of 'origin/master' by 4 commits.
  #   (use "git push" to publish your local commits)
  #
  nothing to commit, working directory clean
  </code></pre>
  
  <p>and I'm back where I started.</p>
  
  <p>What is going on here? What should I do to get to a state where my local master has the latest updates from upstream?</p>