title: How does the git tag command know which commit to tag?
body: <p>I am new to source control and Git. I am using a book and finding it difficult to make much progress. Please help me to understand Git.</p>
  
  <p>My Book - Git: Version control for everyone. </p>
  
  <p>Topic - Git tagging. </p>
  
  <p>Steps - </p>
  
  <p><em>First, CD into "capuccino" repo on local system (provided by book).</em></p>
  
  <p><strong>Tagging comes in handy when you want to mark a specific point in your history with some metadata and refer to it henceforth with the same tag. We have two types of tags in Git - Lightweight and Annotated.</strong></p>
  
  <p>Now let's create a lightweight tag in our  cappuccino repository by executing the following:
  <code>git tag edge_v1.1</code></p>
  
  <p><strong>What just happened?
  We have successfully created and attached a lightweight/unannotated tag to a specific commit. We also learned to list out all the tags available in the repository and if needed, view granular level changes associated with any given tag.</strong></p>
  
  <p>I don't understand which specific commit is being marked/tagged by this command. I would expect a tagging command to be like this pseudocode <code>git tag COMMID_ID=XXX edge_v1.1</code>. Please explain what really happened because of the tag command and how tagging really works. </p>
  
  <p>The book then says some other stuff -</p>
  
  <p><strong>We read about referencing a commit with the tag names instead of the commit SHA1 ID. Let's understand what this means, practically.</strong></p>
  
  <p><strong>We have learned  git checkout as a function to travel back in history. As you know, this process needs the SHA1 ID of the commit, which you would like to visit. Now let's see how it can be done 
  when it comes to handling tags. Type the following commands in your CLI window:</strong></p>
  
  <pre><code>git checkout 2e361b44
  git checkout edge_v1.1
  </code></pre>
  
  <p><strong>We checked out to a commit made at an earlier date using the usual checkout ( git checkout SHA1 ID ) method but came back to the latest commit with the usage of the tag name associated with the commit ( edge_v1.1 ).</strong></p>
  
  <p>What does this last paragraph mean ?</p>