【问题标题】:How can I list all branches with dates and hashes?如何列出所有带有日期和哈希值的分支?
【发布时间】:2023-01-20 22:14:52
【问题描述】:

如何获得包含名称、日期和哈希值的所有分支的列表?

我可以通过以下方式获得包含姓名和日期的列表

git branch -r --format='%(refname:short) %(committerdate:short)'

我可以向命令添加什么以包含提交哈希?

添加%H 不起作用,我已经试过了。

【问题讨论】:

    标签: git


    【解决方案1】:

    根据git help git-for-each-refgit help branch指给你),你正在寻找objectname

    objectname
        The object name (aka SHA-1). For a non-ambiguous abbreviation of
        the object name append :short. For an abbreviation of the object
        name with desired length append :short=<length>, where the minimum
        length is MINIMUM_ABBREV. The length may be exceeded to ensure
        unique object names.
    

    【讨论】:

    • 太棒了,谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-08
    • 1970-01-01
    • 1970-01-01
    • 2017-05-30
    • 2014-04-13
    • 2011-10-24
    相关资源
    最近更新 更多