Title: Get annotated tags · gitpython-developers/GitPython · Discussion #1937 · GitHub
Open Graph Title: Get annotated tags · gitpython-developers/GitPython · Discussion #1937
X Title: Get annotated tags · gitpython-developers/GitPython · Discussion #1937
Description: Get annotated tags
Open Graph Description: I need to use GItPython API to get annotated tags. If I do next: repo = git.Repo(repo_path) tags = repo.tags annotated_tags = [tag for tag in tags] I get list of lightweight tags. How do I get a li...
X Description: I need to use GItPython API to get annotated tags. If I do next: repo = git.Repo(repo_path) tags = repo.tags annotated_tags = [tag for tag in tags] I get list of lightweight tags. How do I get a li...
Opengraph URL: https://github.com/gitpython-developers/GitPython/discussions/1937
X: @github
Domain: togithub.com
{"@context":"https://schema.org","@type":"QAPage","mainEntity":{"@type":"Question","name":"Get annotated tags","text":"I need to use GItPython API to get annotated tags. If I do next:
\nrepo = git.Repo(repo_path) tags = repo.tags annotated_tags = [tag for tag in tags]
\nI get list of lightweight tags. How do I get a list of annotated tags?
\nI need for annotated tags info: tag, tagger, tagged_date
\nThanks for any help
","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Maybe this helps: https://chatgpt.com/share/b1010a46-8079-414e-89ab-da43b2af90b9 .
\nHere is a copy of the code it produced:
\nimport git\n\n# Path to your repository\nrepo_path = '/path/to/your/repo'\n\n# Initialize the Repo object\nrepo = git.Repo(repo_path)\n\n# Get all tags\nall_tags = repo.tags\n\n# Filter annotated tags\nannotated_tags = [tag for tag in all_tags if tag.tag is not None]\n\n# Print the annotated tags\nfor tag in annotated_tags:\n print(f\"Annotated Tag: {tag.name}\")\n print(f\"Tag Message: {tag.tag.message}\")\n print(f\"Tag Object: {tag.tag.object}\")
","upvoteCount":1,"url":"https://github.com/gitpython-developers/GitPython/discussions/1937#discussioncomment-9961221"}}}
| route-pattern | /_view_fragments/Voltron::DiscussionsFragmentsController/show/:user_id/:repository/:discussion_number/discussion_layout(.:format) |
| route-controller | voltron_discussions_fragments |
| route-action | discussion_layout |
| fetch-nonce | v2:1655fb1c-8b32-c171-454b-71dbc7369aeb |
| current-catalog-service-hash | 9f0abe34da433c9b6db74bffa2466494a717b579a96b30a5d252e5090baea7be |
| request-id | BEDC:2B2A2E:1F1E82B:2C02EA3:69690C18 |
| html-safe-nonce | 1c0416335ce0f9ad1e9321391491a911f7192772af960b8332f886603e2b1121 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRURDOjJCMkEyRToxRjFFODJCOjJDMDJFQTM6Njk2OTBDMTgiLCJ2aXNpdG9yX2lkIjoiNzAzMzc4Nzk0MzEwMzM5NjA4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 00331389510df5a5544211b6833047149d1c49015aad70f33373fa4e5eca04ae |
| hovercard-subject-tag | discussion:6898272 |
| github-keyboard-shortcuts | repository,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/Voltron::DiscussionsFragmentsController/show/gitpython-developers/GitPython/1937/discussion_layout |
| twitter:image | https://opengraph.githubassets.com/58f2229da8cb2143093130167ac6f093f895075944b27d54696a69f6c9b0f793/gitpython-developers/GitPython/discussions/1937 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/58f2229da8cb2143093130167ac6f093f895075944b27d54696a69f6c9b0f793/gitpython-developers/GitPython/discussions/1937 |
| og:image:alt | I need to use GItPython API to get annotated tags. If I do next: repo = git.Repo(repo_path) tags = repo.tags annotated_tags = [tag for tag in tags] I get list of lightweight tags. How do I get a li... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | e6156bd4ef9f2dc8dadf4c49a8f7ed8532186388cef72eda3ccb9f0ab3b8cfca |
| turbo-cache-control | no-preview |
| go-import | github.com/gitpython-developers/GitPython git https://github.com/gitpython-developers/GitPython.git |
| octolytics-dimension-user_id | 503709 |
| octolytics-dimension-user_login | gitpython-developers |
| octolytics-dimension-repository_id | 1126087 |
| octolytics-dimension-repository_nwo | gitpython-developers/GitPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1126087 |
| octolytics-dimension-repository_network_root_nwo | gitpython-developers/GitPython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ee2210c3e58153aae53400c942f8a7b4bbb43ec4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width