Tuesday, August 22, 2017

Git tag and github release

Git Tag

Git tag is nothing but a marker or symbol for a point in time snapshot of your git repository.

There are two types of tags in git:

Lightweight Tag

A pointer to a specific commit. It only has a tag name.

Annotated Tag  

In addition to putting a marker on a specific commit, git physically create the snapshot of all files and keep it internally with a tag message, email, and a date.

To create a tag for a given commit, the command syntax is:

git tag tag_name commit_id

To push the tag to the remote repository

git push remote_name tag_name

Github Release

Release is a concept of github, it internally uses git tag to create a static point of time snapshot. The details can be found at https://help.github.com/articles/creating-releases/.

Releases can be created on:

  1. Current head of master or branches

  2. Existing tags

  3. Recent past commits.