【发布时间】:2023-01-20 22:14:52
【问题描述】:
如何获得包含名称、日期和哈希值的所有分支的列表?
我可以通过以下方式获得包含姓名和日期的列表
git branch -r --format='%(refname:short) %(committerdate:short)'
我可以向命令添加什么以包含提交哈希?
添加%H 不起作用,我已经试过了。
【问题讨论】:
标签: git
如何获得包含名称、日期和哈希值的所有分支的列表?
我可以通过以下方式获得包含姓名和日期的列表
git branch -r --format='%(refname:short) %(committerdate:short)'
我可以向命令添加什么以包含提交哈希?
添加%H 不起作用,我已经试过了。
【问题讨论】:
标签: git
根据git help git-for-each-ref(git 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.
【讨论】: