title: Will the working directory be updated when the current branch is updated?
body: <p>Before my questions, I would like to know if my understanding of some Git concepts is correct, and please feel free to correct me:</p>
  
  <ul>
  <li>a branch name points to the tip (i.e. the end commit) of a branch, and </li>
  <li>HEAD points to the branch name of the current branch, and </li>
  <li>the current branch is defined as the branch checked out into the working directory.</li>
  </ul>
  
  <p>Here are my questions:</p>
  
  <ol>
  <li><p>When a new commit is added to <strong>a branch</strong> by a git command (any git command that can add commits to a branch), </p>
  
  <p><strong>Questions:</strong></p>
  
  <p>does the git command always move the branch name forward to point to
  the new commit?   </p>
  
  <p>Or are there git commands, which add new commits to a branch, which
  do not move the branch name and thus require me running some
  additional git command to move it?</p></li>
  <li><p>When </p>
  
  <ul>
  <li>a new commit is added to <strong>the current branch</strong> by a git command and </li>
  <li>the branch name is moved forward to point to the new tip commit in the current branch, </li>
  </ul>
  
  <p><strong>Questions:</strong></p>
  
  <ul>
  <li><p>is it necessary to update HEAD additionally?  </p>
  
  <p><strong>My guess</strong> is no, because HEAD has already pointed to the current branch's name, the
  current branch's name has already been updated to point to the new
  tip commit of the current branch, and moving the current branch's
  name doesn't change the fact that HEAD points to the current
  branch's name. So all looks fine without additional change to HEAD.</p></li>
  <li><p>has the working directory already been updated to be the same as the new tip commit of the branch?    </p>
  
  <p>Or can the working directory
  still be the same as the previous tip commit of the branch, and, in
  order to check out the new tip commit of the current branch into the
  working directory, I need to run some  additional git command?</p></li>
  </ul>
  
  <p>The followings are two cases/examples with <strong>concrete git commands</strong> (<code>git push</code> and <code>git pull</code>), which made me think of and ask the above two parts' questions for <strong>arbitrary git commands</strong> that can add commits to a branch or to the current branch:</p></li>
  <li><p><strong><code>git push</code></strong> adds new commit(s) to a branch on the remote
  repository.  </p>
  
  <p>Now suppose </p>
  
  <ul>
  <li>the remote repository isn't bare i.e. has a
  working directory, and </li>
  <li>right before pushing, the current branch of
  the remote repository is the branch to push to. </li>
  </ul>
  
  <p><strong>Questions:</strong></p>
  
  <ul>
  <li><p>in the remote repository, does <code>git push</code> move the branch name to point to the new tip commit? </p>
  
  <p>Or does the user of the remote repository have to run some additional git command to move it?</p></li>
  <li><p>In the remote repository, does <code>git push</code> update the working directory to be the same as the new tip commit? </p></li>
  <li><p>I.e. in the remote repository, is the updated version (by <code>git
  push</code>) of the current branch ("current" before <code>git push</code>) still the
  current branch after <code>git push</code>? (note the definition of a current
  branch I gave at the beginning of the post: "the current branch is
  defined as the branch checked out into the working directory.")</p></li>
  </ul>
  
  <p><strong>My guess</strong> is no, if I understand correctly from Version Control with
  Git by Loeliger 2ed which says:</p>
  
  <blockquote>
    <p>Recall that the git push command does not check out files in the
    receiving repository. It simply transfers objects from the source
    repository to the receiving repository and then updates the
    corresponding refs on the receiving end.</p>
    
    <p>In a bare repository, this behavior is all that can be expected,
    because there is no working directory  that  might  be  updated  by 
    checked  out  files.  That’s  good.  However,  in  a development
    repository that is the recipient of a push operation, it can later
    cause confusion to anyone using the development repository.</p>
    
    <p>The push operation can update the repository state, including the HEAD
    commit. That is, even though the developer at the remote end has done
    nothing, the branch refs and HEAD might change, becoming out of sync
    with the checked out files and index.</p>
    
    <p>A developer who is actively working in a repository into which an
    asynchronous push happens will not see the push. But a subsequent
    commit by that developer will occur on an unexpected HEAD, creating an
    odd history. A forced push will lose pushed commits from the other
    developer. The developer at that repository also may find herself
    unable to reconcile her history with either an upstream repository or
    a downstream clone because they are no longer simple fast-forwards as
    they should be. And she won’t know why: the repository has silently
    changed out from underneath her. Cats and dogs will live together.
    It’ll be bad.</p>
  </blockquote></li>
  <li><p>In <strong><code>git pull</code></strong> command, the merge step merges the newly fetched remote tracking branch into the current branch. If I am correct, the merge step of <code>git pull</code> also advances the banch name of the branch to point to the new top commit on the branch. </p>
  
  <p><strong>Question:</strong></p>
  
  <ul>
  <li><p>In the local repository, does <code>git pull</code> update the working directory to be the same as the new fetched tip commit?</p></li>
  <li><p>I.e. In the local repository, is the updated version (by <code>git pull</code>) of the current branch ("current" before <code>git pull</code>) still the current branch after <code>git pull</code>? (note the definition of a current branch I gave at the beginning of the post: "the current branch is defined as the branch checked out into the working directory.")</p></li>
  </ul>
  
  <p>I have asked the question about <code>git pull</code>   at <a href="https://stackoverflow.com/questions/34503331/does-git-pull-check-out-the-current-branch-after-its-merge-rebase-step">Does git pull check out the current branch after its merge/rebase step?</a>. 
  From my understanding, what Joseph's reply means is <code>git pull</code> checks out the new fetched tip commit into the working directory of the local repository, and I don't need to run additional git commands to check it out.
  torek's reply is great, but it will be a while until I could understand it.</p></li>
  </ol>