Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7029559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:33:18+00:00 2026-05-28T00:33:18+00:00

so the git tag command lists the current git tags tag1 tag2 git tag

  • 0

so the git tag command lists the current git tags

tag1
tag2

git tag -n prints tag’s message

tag1  blah blah
tag2  blah blah

What’s the best way to get the hash of tag1 & tag2 ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T00:33:18+00:00Added an answer on May 28, 2026 at 12:33 am

    To get git tags with the SHA1 hash of the Tag object, you can run:

    git show-ref --tags
    

    The output will then look something like:

    0e76920bea4381cfc676825f3143fdd5fcf8c21f refs/tags/1.0.0
    5ce9639ead3a54bd1cc062963804e5bcfcfe1e83 refs/tags/1.1.0
    591eceaf92f99f69ea402c4ca639605e60963ee6 refs/tags/1.2.0
    40414f41d0fb89f7a0d2f17736a906943c05acc9 refs/tags/1.3.0
    

    Each line is the SHA1 hash of the tag, followed by the tag name prefixed with refs/tags/.

    If you want the SHA1 hash of the commit, instead of the tag object, you can run:

    git show-ref --tags -d
    

    This will produce output like:

    0e76920bea4381cfc676825f3143fdd5fcf8c21f refs/tags/1.0.0
    3e233dd8080617685992dc6346f739a6f6396aae refs/tags/1.0.0^{}
    5ce9639ead3a54bd1cc062963804e5bcfcfe1e83 refs/tags/1.1.0
    09173980152a7ed63d455829553448ece76c6fdc refs/tags/1.1.0^{}
    591eceaf92f99f69ea402c4ca639605e60963ee6 refs/tags/1.2.0
    56d803caaa8a93a040b7be0b8a36abdc4ce8c509 refs/tags/1.2.0^{}
    40414f41d0fb89f7a0d2f17736a906943c05acc9 refs/tags/1.3.0
    1bdf628a70fda7a0d840c52f3abce54b1c6b0130 refs/tags/1.3.0^{}
    

    The lines ending with ^{} start with the SHA1 hash of the actual commit that the tag points to.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there an easy way or command to get all git commits up to
What's the simplest way to get the most recent tag in Git? git tag
I need Git command to get/find last tag starting with 'v' to get last
In my repository, I have created tags using the following commands. git tag v1.0.0
I am looking for the best and safest way to convert a git branch
Is there a cleaner way to get the short version hash of HEAD from
I'm currently using a collection of three commands to get the current tag, branch
I want to execute a command like 'git tag -l' inside a directory /home/user/git/app/
$ git tag hello $ git describe --tags hello ... work work ... $
When doing a git tag , I'm not always great at remembering if HEAD~6

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.