I was under the impression that a tag would act like a commit in that if I have a clone based on an old commit, I wouldn’t expect to see new tags listed in the git tag output.
However, this assumption is evidently wrong. It kinds wrecks the way I was planning to use tags. I am using simple tags. Would some other type of tag work differently as far as time goes?
I’m not sure of your goal, but git doesn’t make it easy to sort the tags by the date of the commits pointed to.
After some research and effort I came up with this:
Sample output:
With a little tweaking, this can also works with “git branch” to handle the asterisk indicating the current branch.
Another command that may be helpful…
Include the ref names (branch, tags, etc) in the log output:
Do you have a workflow or script that relies on the assumption that newer tags don’t exist in old clones?
If you’re cloning a local repo, you could try “git clone –no-hardlinks”. But it may not be the best solution for your goals.