`git tag` sorted in chronological order of the date of the commit pointed to

前端 未结 7 1748
礼貌的吻别
礼貌的吻别 2020-12-13 12:44

The output from git tag is ordered alphabetically. I would like it to be ordered chronological (the date of the commits they are assigned to, not the date on wh

7条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-13 12:56

    Just tested with git 2.8.0:

    git tag --sort=committerdate
    

    For a full list of field names you can use, see https://git-scm.com/docs/git-for-each-ref#_field_names

    For commit and tag objects, the special creatordate and creator fields will correspond to the appropriate date or name-email-date tuple from the committer or tagger fields depending on the object type. These are intended for working on a mix of annotated and lightweight tags.

    Fields that have name-email-date tuple as its value (author, committer, and tagger) can be suffixed with name, email, and date to extract the named component.

提交回复
热议问题