How to tag a commit in git

Steps:

Check out to a branch say “dev”

>> git checkout dev

>> git log

3rd commitUpgraded to version 4.4 – 6d2bba2f3a2cde13bce0d3e7e06bc06da71735a4
2nd commitcompatibility issue fix – 9b3382b0b2ba1e220db747b9eb0a0d1a9a4322d5
1st commitAdded loggers – cabb225b09ba93a22441bf841300904ead51bf28

Suppose if you need to tag the 3rd commit with tag value, v4.4

>> git tag -a v4.4 -m “v4.4”

to list all tags >> git tag
to view commit-tag association >> git show v4.4

>> git push origin v4.4

You can view the tag under Branch > tags on github.com,
tags-view

Advertisements
How to tag a commit in git

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s