DEV Community

Dênis Mendes
Dênis Mendes

Posted on • Edited on

1

Tag on Git

Tag is a nice way to keep system versions clear and arranged.
I like to tag my commits after I did them so I do tag like that:

First I run:

git log to see the commit checksum that I'll tag.

After I run:

git tag -a v1.2 9fceb02

Where 9fceb02 is my commit checksum.

So we have a new tag but it's only locally yet. Then I run:

git push --tags

Done!

If you need to see which tags were created you can run:

git tag

UPDATE I:
So some day you want to see the source code to the tag v1.2 what you need to do is that:

git checkout tags/v1.2

Now you're going to be able see the source code from tag v1.2.

UPDATE II:
You can see the log for a tag as well:

git log v1.2

Do you want to know more? Look at: https://git-scm.com/book/en/v2/Git-Basics-Tagging

UPDATE III:

I needed to remove a tag which I related with the wrong commit reference so I did that:

git push origin :tag_name

and also:

git tag --delete tag_name (it goes to delete locally)

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

Top comments (0)

Heroku

This site is powered by Heroku

Heroku was created by developers, for developers. Get started today and find out why Heroku has been the platform of choice for brands like DEV for over a decade.

Sign Up

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay