How to tag old/specific commit on git

Steps:

Check out to a branch say “dev”

>> git checkout dev

>> git log

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

Suppose if you need to tag the 2nd commit with tag value, v4.3, copy the portion to commit’s hash code

>> git tag -a v4.3 9b3382b0b2 -m “v4.3”

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

>> git push origin v4.3

(also see: basic git tagging)

 

Advertisements
How to tag old/specific commit on 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