Is there a way to get git to list all the tags that were added in between two commits? That is, only show me the tags that appear between point A and point B.
Comparing The Two TagsUsing the same side menu, select one of your commits as the compare branch. Now, select the 'Compare Tags' option on the other tag and start comparing the two tags. Click 'Files' to see what has changes between the two tags.
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.
To fetch tags from your remote repository, use “git fetch” with the “–all” and the “–tags” options. Let's say for example that you have a tag named “v1. 0” that you want to check out in a branch named “release”. Using this command, you have successfully checked out the “v1.
You can use the git log
command with these options:
git log tagA...tagB --decorate --simplify-by-decoration
--decorate
displays the tag names next to the commit, and --simplify-by-decoration
shows only commits that have been tagged.
If you only wants the tag name list (in reverse chronological order) between commit1
and commit2
, you can combine git log
with xargs
and git tag --points-at
:
git log commit1..commit2 --simplify-by-decoration --format=format:%h | xargs -L1 git tag --points-at
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With