-1

I am using the bitbucket git repository for my project. I created the multiple tags for my project. Many times I switch the tag for testing purpose.

I written the shell script for deployment. I want to check through command line which git tag I am using currently.

I checked the git help but I did not found any command which will tell you which git tag you are using currently.

Is there any git command present which will tell you about git tag information.

purab
  • 211
  • 1
  • 3
  • 9

1 Answers1

1

I guess you're looking for this:

git describe --tags

This shows the most recent tag that is reachable from the last commit of whatever branch or tag your are on, or from a specified commit or branch.

UPDATE

You say you are getting this:

portal_1.6_20131126-42-g6755a2c

This looks like the long format, composed of:

  • portal_1.6_20131126 -- the tag
  • 42 -- the number of commits since the tag
  • 6755a2c -- the abbreviated commit name of the selected commit or HEAD

For me the long format is not the default. Maybe you're using a different version or it's set in your configuration. You can override that this way:

git describe --tags --no-long
janos
  • 120,954
  • 29
  • 226
  • 236
  • When I executed above given command I got the following result. [purab@PURAB-PC marco]$ git describe --tag verify – purab Nov 29 '13 at 07:25