title: Git: Fetching latest commit on a branch
body: <p>I'm struggling to understand something about GIT.</p>
  
  <p>We've got a repository with a number of branches in it. I can fetch a local copy of one of those branches (git checkout -b ...), make some changes, then push them back. If I fail to tag the end of the branch, however, how do other users get the head of the branch? WHen they use git checkout to fetch the branch they get the code at the point of the branch -- not the head of that branch.</p>
  
  <p>What am I missing here?</p>
  
  <p>EDIT: I came into this project late and was involved in the CVS to GIT conversion. I am assuming that the FOO_3_4_0001... tags all mark points along the branch kicked off with FOO_3_4_0001_INITIAL. How can I check?</p>
  
  <p><strong>EDIT 2: Thanks to everyone who contributed answers. It turns out that tag FOO_3_4_0001 was not on the 3.4 branch and that's what I was missing all along. I have already arranged the lynching party.</strong></p>
  
  <hr>
  
  <p>@ghoseb, didn't work. I tried this:</p>
  
  <pre><code>16:19:29 (1) foo $ git checkout --track -b FOO_3_4_0001_INITIAL origin/FOO_3_4_0001_INITIAL
  Branch FOO_3_4_0001_INITIAL set up to track remote branch refs/remotes/origin/FOO_3_4_0001_INITIAL.
  Switched to a new branch "FOO_3_4_0001_INITIAL"
  16:19:36 (1) foo $ git branch
  * FOO_3_4_0001_INITIAL
    master
  16:19:39 (1) foo $ git pull
  remote: Counting objects: 68, done.
  remote: Compressing objects: 100remote: % (59/59), done.
  remote: Total 61 (delta 18), reused 0 (delta 0)
  Unpacking objects: 100% (61/61), done.
  From ssh://***
     f0c5a5f..99f6c1e  master     -&gt; origin/master
  Already up-to-date.
  16:19:42 (1) foo $
  </code></pre>
  
  <p>At this point I checked for the change I made on this branch and it's not there. If I check out the code tagged FOO_3_4_0001_RC5a my change is there.</p>
  
  <hr>
  
  <p>Ok, more info for @Dustin and @mipadi.</p>
  
  <p>When I run <code>git branch -r</code>, I see:</p>
  
  <pre><code>16:12:02 (1) foo $ git branch -r
    origin/FOO_3_3_0001_BUILT_VF_BRANCH
    origin/FOO_3_4_0001_INITIAL
    origin/FOO_3_5_0000_RC5
    origin/FOO_3_5_0001_BRANCH
    origin/HEAD
    origin/master
    origin/origin
  16:12:05 (1) foo $
  </code></pre>
  
  <p>And if I look at the list of tags, I see, among other things:</p>
  
  <pre><code>16:12:05 (1) foo $ git tag -l
  FOO_3_4_0000_RC1
  FOO_3_4_0000_RC2
  FOO_3_4_0000_RC2b
  FOO_3_4_0000_RC3
  FOO_3_4_0000_RC4
  FOO_3_4_0000_RC4b
  FOO_3_4_0000_RC5
  FOO_3_4_0000_RELEASE
  FOO_3_4_0000_TC1
  FOO_3_4_0000_TC2
  FOO_3_4_0001_RC2
  FOO_3_4_0001_RC3
  FOO_3_4_0001_RC4
  FOO_3_4_0001_RC5
  FOO_3_4_0001_RC5a
  FOO_3_4_0001_TC1
  16:14:33 (1) foo $
  </code></pre>
  
  <p>The challenge I have is knowing what the latest code on the FOO_3_4_0001_INITIAL branch is.</p>
  
  <p>Now in this instance I happen to know that it's FOO_3_4_0001_RC5a, but if I don't (as will sometimes be the case for some of our developers) how do I check out the origin_FOO_3_4_0001_INITIAL branch know that I've got the very latest code on that branch?</p>