Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git command to show all (lightweight) tags creation dates

Tags:

git

date

tags

People also ask

How do I see tags in git?

Listing the available tags in Git is straightforward. Just type git tag (with optional -l or --list ). You can also search for tags that match a particular pattern. The command finds the most recent tag that is reachable from a commit.

How do I get a list of tags?

In order to list Git tags, you have to use the “git tag” command with no arguments. You can also execute “git tag” with the “-n” option in order to have an extensive description of your tag list. Optionally, you can choose to specify a tag pattern with the “-l” option followed by the tag pattern.

Which command correctly creates a lightweight tag in git?

git push <remote> --tags will push both lightweight and annotated tags. There is currently no option to push only lightweight tags, but if you use git push <remote> --follow-tags only annotated tags will be pushed to the remote.

How do I know if my tag is annotated or lightweight?

If the tag is an annotated tag, you'll see the message and the tag object, followed by the commit. If the tag is a lightweight tag, then you'll see only the commit object. If the current commit exactly matches that of a tag, then only the tag name is printed.


I found in this link a solution that fits my needs:

git log --tags --simplify-by-decoration --pretty="format:%ai %d"

I've put that command in an alias in my ~/.alias, so now everytime I run gitshowtagbydate I get what I needed.


The git tag -l shows a list of all tags. The --format argument can be used to define a custom output. For example:

git tag -l --format='%(refname)   %(taggerdate)'

Update, based on the comments below:

 git tag -l --sort=-creatordate --format='%(creatordate:short):  %(refname:short)'