什么是我可以在--format选项中使用的有效git字段 [英] What are valid git fields that I can use in --format option
问题描述
我试图找到在资源库上创建的第一个分支。为此,我使用了:
git for-each-ref --sort = commiterdate --format ='%(commiterdate:short)% (refname:short)'--count = 1
然而,我想了解更多关于这个分支的信息。 I.e这个分支住了多久,何时合并回主干线等。
是否有一个可用的字段选项列表?我尝试了很多搜索引擎,但找不到任何东西。
谢谢
我在git存储库上找到了一个字段列表,文件builtin / for-each-ref.c :
} valid_atom [] = {
{ refname},
{objecttype},
{objectsize,FIELD_ULONG},
{objectname},
{tree},
{parent},
{numparent,FIELD_ULONG},
{object},
{type},
{tag},
{author},
{authorname},
{authoremail},
{authordate,FIELD_TIME},
{committer},
{committername},
{committeremail},
{committerdate,FIELD_TIME},
{tagger},
{taggername },
{taggeremail},
{taggerdate,FIELD_TIME},
{creator},
{ creatordate,FIELD_TIME},
{subject},
{body},
{contents},
{contents:subject},
{contents:body},
{contents:signature},
{upstream},
{symref},
{flag },
{HEAD},
{color},
};
I am trying to find the first branch that was created on a repository. To do so I used:
git for-each-ref --sort=commiterdate --format='%(commiterdate:short) %(refname:short)' --count=1
However I want more information on this branch. I.e how long this branch lived, when was it merged back to the master trunk etc. Is there a list of field options available somewhere? I tried googling a lot but couldn't find anything.
Thanks
I've found a field list on git repository, file builtin/for-each-ref.c:
} valid_atom[] = {
{ "refname" },
{ "objecttype" },
{ "objectsize", FIELD_ULONG },
{ "objectname" },
{ "tree" },
{ "parent" },
{ "numparent", FIELD_ULONG },
{ "object" },
{ "type" },
{ "tag" },
{ "author" },
{ "authorname" },
{ "authoremail" },
{ "authordate", FIELD_TIME },
{ "committer" },
{ "committername" },
{ "committeremail" },
{ "committerdate", FIELD_TIME },
{ "tagger" },
{ "taggername" },
{ "taggeremail" },
{ "taggerdate", FIELD_TIME },
{ "creator" },
{ "creatordate", FIELD_TIME },
{ "subject" },
{ "body" },
{ "contents" },
{ "contents:subject" },
{ "contents:body" },
{ "contents:signature" },
{ "upstream" },
{ "symref" },
{ "flag" },
{ "HEAD" },
{ "color" },
};
这篇关于什么是我可以在--format选项中使用的有效git字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!