Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何只输出--漂亮;git版本列表的一部分?_Git_Git Rev List - Fatal编程技术网

如何只输出--漂亮;git版本列表的一部分?

如何只输出--漂亮;git版本列表的一部分?,git,git-rev-list,Git,Git Rev List,git版本列表--pretty='%H%an%at'源代码/主题分支^origin/master 产出如下: commit d2d0b50ceac50cc81cf991ce09ab3db134af751d d2d0b50ceac50cc81cf991ce09ab3db134af751d John Doe <john@doe.com> 1592392426 commit c5e1438a6ef2e6090c3f9dd9df0a5834b32b50b1 c5e1438a6ef2e6090

git版本列表--pretty='%H%an%at'源代码/主题分支^origin/master

产出如下:

commit d2d0b50ceac50cc81cf991ce09ab3db134af751d
d2d0b50ceac50cc81cf991ce09ab3db134af751d John Doe <john@doe.com> 1592392426
commit c5e1438a6ef2e6090c3f9dd9df0a5834b32b50b1
c5e1438a6ef2e6090c3f9dd9df0a5834b32b50b1 John Doe <john@doe.com> 1592393061
提交d2d0b50ceac50cc81cf991ce09ab3db134af751d
D2D0B50CEA50CC81CF991CE09AB3DB134AF751D无名氏1592392426
提交c5e1438a6ef2e6090c3f9dd9df0a5834b32b50b1
c5e1438a6ef2e6090c3f9dd9df0a5834b32b50b1约翰多伊1592393061
所需的输出应仅包括由漂亮格式的占位符组成的字符串,如下所示:

d2d0b50ceac50cc81cf991ce09ab3db134af751d John Doe <john@doe.com> 1592392426
c5e1438a6ef2e6090c3f9dd9df0a5834b32b50b1 John Doe <john@doe.com> 1592393061
d2d0b50ceac50cc81cf991ce09ab3db134af751d无名氏1592392426
c5e1438a6ef2e6090c3f9dd9df0a5834b32b50b1约翰多伊1592393061
我不知道如何去掉
rev list

git rev list origin/topic branch^origin/master打印的默认行|
git rev-list origin/topic-branch ^origin/master |
    while read sha1; do
        git --no-pager show -s --pretty='%H %an <%ae> %at'
    done
读sha1时;做 git--无寻呼机显示-s--漂亮=“%H%an%at” 完成
这个技巧的主要部分是
git show-s
,它跳过提交头,只打印漂亮的部分。

git rev list origin/topic branch^origin/master|
读sha1时;做
git--无寻呼机显示-s--漂亮=“%H%an%at”
完成

这个技巧的主要部分是
git show-s
,它跳过提交头,只打印漂亮的部分。

您可以导入git rev list的输出,并添加一个grep查询,查询不以单词
commit开头的行。
事实上,我可以使用
导入grep-v“^commit”
但我想知道git中是否有现成的解决方案,因为我需要尽快编写更多类似的命令。当您明确指定一种格式时,rev list和log之间的唯一区别是没有标题行。因此,您可以只使用`git log--pretty='%H%an您可以在git rev list的输出中插入管道,并为不以单词
commit
开头的行添加grep查询确实,我可以使用
|grep-v“^commit”
管道,但我想知道git中是否有现成的解决方案,因为我需要尽快编写更多这样的命令。当您明确指定一种格式时,rev list和log之间的唯一区别就是没有标题行。所以您可以只使用`git log--pretty='%H%an