以下是两个命令及其结果示例:
$ git show
commit 6f367e05cc6457fd0c0fc59fe0476db06cffb383 (HEAD -> master, tag: v7.32, origin/master, origin/HEAD)
Merge: 94ecf1d8 f3ea52b0
Author: Pupkin <pupkin@server.com>
Date: Fri Dec 13 12:49:12 2019 +0700
Some commit description.
$ echo `git show`
commit 6f367e05cc6457fd0c0fc59fe0476db06cffb383 Merge: 94ecf1d8 f3ea52b0 Author: Pupkin <pupkin@server.com> Date: Fri Dec 13 12:49:12 2019 +0700 Some commit description.
重要的区别是:在第二个结果中,没有关于分支的信息-“(HEAD->;master,tag:v7.32,origin/master,origin/HEAD)”
我还尝试了将stdout和stderr重定向到彼此,重定向到文件,grep,以及其他一些构造。同样的结果,在控制台中显示所有内容,在其他情况下-没有分支信息
为什么会这样
如何强迫git返回整个消息
正如上面评论中所说的@ElpieKay,我需要在命令中使用键
decorate
从Git manual开始:
但我非常确定,在默认情况下使用
auto
而不是short
,正如手册中所说的那样这个问题解决了
相关问题 更多 >
编程相关推荐