SAGARFIVE

1. Introduction

2. Git Basics

3.  Git Terminology

4.  Git Branching

5.  Git - Github

6.  Git Add (Git staging)

7.  Git Commit

8.  Github Advanced

9.  Git Remote

8.4 Git tag & Github tag

Tags make a point as a specific point in Git history. Tags are used to mark a commit stage as relevant. We can tag a commit for future reference. Primarily, it is used to mark a project’s initial point like v1.1.

  • When we want to create a release point for a stable version of your code we use git tag or
  • When we want to create a historical point that you can refer to reuse in the future.we create tag
  • Tags are much like branches, and they do not change once initiated.
  • We can have any number of tags on a branch or different branches
  • Tags are named like v0.1, v1.0…



Git Tag Types : 

1. Annotated tag : 

  • It’s tag that store some more info that usual tag, such as Developer name , email, date and some info message
    Example :  git tag <tag name> -m ” <Tag message> -a <developer-x1>

2. Light-Weighted Tag : 

  • It does not store more information and makes it light-weight.

Example :git tag <tag name> 

     git tag project-v1.0  

Git Tag Commands :

1Git Creating Annotated taggit checkout <Branch name> 
git tag <tag name> -m ” <Tag message> -a <developer-x1>
git tag project-one-v0.1 -m “Version 0.1” -a “Developer-x1”
2Git Create taggit checkout <Branch name> 
git tag <tag name>
git tag project-v1.0  
3Git List Taggit tag or
git show
4To see Specific tag infogit tag show project-v1.0  
5List tags with filter patterngit tag -l “<pattern>.*”
git tag -l “project-one*”  
6Deleting Tagsgit tag –d <tagname>  or
git tag –d project-v1.0  
7Delete a Remote Taggit push origin -d <tagname>  
8Delete Multiple Tagsgit tag -d <tag1> <tag2> 
9Git Checkout Tags with branchgit checkout -b < new-branch-name> <tag-name>  
10Create a tag from an older commit:git tag <tagname> < commit-hash> 
git tag <project-one-v2.2> 6tgf877ytd
11Renaming tag(i) Create new tag : git tag <new_tag_name> <old_tag_name>
Example : git tag v1.7 v1.6(ii) Delete old tag : git tag -d <old_tag_name>
Example : git tag -d v1.6
(iii) Pushing the tag : git push origin <new_tag_name> :<old_tag_name>
Example : git push origin v1.8 :v1.7
12Cleaning the tags
collaborators may still have the old tag, this command update the tags on contributors computers
git pull –prune –tags

Pushing the tags to github : 

13Pushing One tag to githubgit push origin <tagname>  
14Pushing all tags at oncegit push origin –tags  
15Deleting a remote taggit push origin -d <tagname>  
16Deleting Multiple remote tagsgit push origin -d <tag1> <tag2>