Git Basics: How to list, search, show, create and push Git tags?


I hope that the last post on "Git Branches" from my "Tutorials on Git Basics" was easy for you to understand. Today we are going to discuss on another topic "Git Tags", which I hope, will help you to easily work with Git Bash commands.

 

Let's continue learning this today with the commands that you need to know. Stay tuned to get more posts on this topic.

 

How to tag a Git branch (www.kunal-chowdhury.com)

 

Like most other source control tools, Git also has the ability to tag or bookmark specific points in history as being important. Typically people use this functionality to mark release points. In this post, you’ll learn how to list the available tags, how to create new tags, what the different types of tags and how to push tags to remote.

 

List all the tags:

$ git tag

 

Search tags for a particular pattern:

$ git tag -l <tag-pattern>

 

Show a tag data:

$ git show <tag-name>

 

Create a Lightweight Tag:

$ git tag <tag-name>

 

Create an Annotated Tag:

$ git tag -a <tag-name> -m <tag-message>

 

Create a tag for a specific commit:

$ git tag -a <tag-name> <commit-checksome>

 

Push a specific tag to remote:

$ git push origin <tag-name>

 

Push all the tags to remote:

$ git push origin --tags

 

Checkout a specific to local:

$ git checkout -b <branch-name> <tag-name>

 

Was this post useful? If you came to this page by searching online about git basics, please have a look into my other blog posts. Subscribe to the RSS feed or the email newsletter to keep yourself updated. If you have any queries, you can either ping me on Twitter or drop a line below in the comments section. Have a great day!

 

 

 


If you have come this far, it means that you liked what you are reading. Why not reach little more and connect with me directly on Twitter, Facebook, Google+ and LinkedIn. I would love to hear your thoughts and opinions on my articles directly. Also, don't forget to share your views and/or feedback in the comment section below.

2 comments

  1. This topic has been something that I have been looking for a few hours. Your advices about using Git Bash commands are quite helpful and I will definitely use them and recommend to my friends. I get to see more helpful advices from you in future.

    ReplyDelete

 
© 2008-2016 Kunal-Chowdhury.com - Microsoft Technology Blog for developers and consumers | Designed by Kunal Chowdhury
Back to top