<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Javier Alonso</title>
    <description>The latest articles on DEV Community by Javier Alonso (@javieralonsocal).</description>
    <link>https://dev.to/javieralonsocal</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F881101%2F84e9c1e8-7a76-4a4b-8f53-1503671cd0d1.png</url>
      <title>DEV Community: Javier Alonso</title>
      <link>https://dev.to/javieralonsocal</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/javieralonsocal"/>
    <language>en</language>
    <item>
      <title>Git Tags: A Complete Guide to Versioning</title>
      <dc:creator>Javier Alonso</dc:creator>
      <pubDate>Sun, 30 Mar 2025 17:16:15 +0000</pubDate>
      <link>https://dev.to/javieralonsocal/git-tags-a-complete-guide-to-versioning-39ik</link>
      <guid>https://dev.to/javieralonsocal/git-tags-a-complete-guide-to-versioning-39ik</guid>
      <description>&lt;p&gt;Git tags are immutable references that point to specific points in a repository's history. They are primarily used to mark important project versions, such as software releases (e.g., v1.0.0, v2.0.0), making it easier to identify key milestones in development. Their use helps maintain a clear and structured version history of the software, helping teams track significant changes and facilitate deployment management.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Use Git Tags?
&lt;/h2&gt;

&lt;p&gt;There are many reasons to use tags in Git, but the most common ones are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Mark official releases&lt;/li&gt;
&lt;li&gt;Allow reverting to previous versions without needing to remember commit hashes&lt;/li&gt;
&lt;li&gt;Facilitate identification of key development milestones&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Types of Tags
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Lightweight Tags
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git tag v1.0.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lightweight tags are merely aliases for a specific commit. They don't have associated metadata and cannot be digitally signed. Therefore, they are not recommended for use in production environments.&lt;/p&gt;

&lt;h3&gt;
  
  
  Annotated Tags
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git tag &lt;span class="nt"&gt;-a&lt;/span&gt; v1.0.0 &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"First stable version"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Annotated tags in Git are a type of tag that stores additional information about a specific commit. Unlike lightweight tags, annotated tags include:&lt;/p&gt;

&lt;p&gt;✅ Tag author&lt;br&gt;
✅ Creation date&lt;br&gt;
✅ Descriptive message (similar to a commit)&lt;br&gt;
✅ Digital signature (optional, for authentication)&lt;/p&gt;
&lt;h2&gt;
  
  
  How to View Your Created Tags?
&lt;/h2&gt;

&lt;p&gt;You can view all your created tags with this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git tag
v1.0.0
v2.0.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Versioning Conventions
&lt;/h2&gt;

&lt;p&gt;Proper software versioning is essential for maintaining clear control of the different stages and changes in a project. One of the most popular methodologies for managing versions is Semantic Versioning or SemVer.&lt;/p&gt;

&lt;p&gt;The semantic versioning format is as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;v1.0.0
│ │ │
│ │ └─ PATCH: Bug fixes
│ └─── MINOR: New features
└───── MAJOR: Breaking changes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Usage Examples
&lt;/h3&gt;

&lt;p&gt;Here are 3 examples of annotated tags for different types of versions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Tagging a major version&lt;/span&gt;
git tag &lt;span class="nt"&gt;-a&lt;/span&gt; v2.0.0 &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Breaking changes: new API"&lt;/span&gt;

&lt;span class="c"&gt;# Tagging a minor version&lt;/span&gt;
git tag &lt;span class="nt"&gt;-a&lt;/span&gt; v1.1.0 &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Added new advanced search feature"&lt;/span&gt;

&lt;span class="c"&gt;# Tagging a patch&lt;/span&gt;
git tag &lt;span class="nt"&gt;-a&lt;/span&gt; v1.0.1 &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Fixed login module bug"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Essential Commands
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# List tags&lt;/span&gt;
git tag

&lt;span class="c"&gt;# Create annotated tag&lt;/span&gt;
git tag &lt;span class="nt"&gt;-a&lt;/span&gt; v1.0.0 &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Version 1.0.0"&lt;/span&gt;

&lt;span class="c"&gt;# Push tags&lt;/span&gt;
git push origin v1.0.0

&lt;span class="c"&gt;# Push all tags&lt;/span&gt;
git push origin &lt;span class="nt"&gt;--tags&lt;/span&gt;

&lt;span class="c"&gt;# Delete tag&lt;/span&gt;
git tag &lt;span class="nt"&gt;-d&lt;/span&gt; v1.0.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Best Practices
&lt;/h2&gt;

&lt;p&gt;✅ &lt;strong&gt;Use annotated tags&lt;/strong&gt; for releases&lt;br&gt;
✅ &lt;strong&gt;Follow SemVer&lt;/strong&gt; for numbering&lt;br&gt;
✅ &lt;strong&gt;Include descriptive messages&lt;/strong&gt;&lt;br&gt;
✅ &lt;strong&gt;Don't modify published tags&lt;/strong&gt;&lt;br&gt;
✅ &lt;strong&gt;Document important changes&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Tags are a best practice for software development as they allow us to maintain a clear and well-structured history of our application versions. Additionally, they help us more easily identify key milestones we've achieved in each version.&lt;/p&gt;

&lt;p&gt;Remember that software development isn't just about creating software, but also about managing the tools we use to create it.&lt;/p&gt;

&lt;p&gt;Therefore, having a clearer and more professional management of our work makes it easier for us to perform our tasks effectively.&lt;/p&gt;

</description>
      <category>git</category>
      <category>gitflow</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
