Time for action – lightweight/unannotated tagging

  1. First, let's list out the existing tags with the cappuccino repository by executing git tag in your CLI window. This should produce an output like the following:
    Time for action – lightweight/unannotated tagging

    The supplied git tag command has retrieved all the tags available in the repository and lists them in alphabetical order.

  2. Now let's create a lightweight tag in our cappuccino repository by executing the following:
    git tag edge_v1.1
    

    If there are no errors returned, your tag should have been created. You can verify it by doing a tag listing, which we learned in the previous step.

    Time for action – lightweight/unannotated tagging
  3. Or you can visualize it by opening gitk, which will give you the following appearance:

    Note

    You can open gitk either from Git Gui's repository menu or by just typing gitk in your CLI window.

    Time for action – lightweight/unannotated tagging
  4. If you want to browse the changes to the files for a given commit that is tagged, you can either look at the bottom left of the gitk window or use git show <tagname> as shown in the following line:
    git show edge_v1.1
    

    This will give an output as shown in the following screenshot:

    Time for action – lightweight/unannotated tagging

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.

We read about referencing a commit with the tag names instead of the commit SHA1 ID. Let's understand what this means, practically.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.79.59