Debian 上的 git log 在提交 ID 附近没有显示本地/远程匹配的分支名称。在Windows上,git-bash正在显示它们。



我在 Windows 7上使用了 git-bash,我在做

时发现非常方便

git log

在每个提交的 sha-1 附近,在其准确的情况下提到了本地或远程分支。

在我必须进行rebase -i时,选择良好的提交ID来汇总我本地分支之前,这确实很有用。

现在到Debian 9,我不需要安装git-bash。但是,git log不再提到我的提交ID的分支机构。这是git-bashgit log命令的特殊自定义,我可以重现?

谢谢

您可能需要使用--decorate选项。来自man git-log

       --no-decorate, --decorate[=short|full|auto|no]
           Print out the ref names of any commits that are shown. If short is specified, the ref name prefixes refs/heads/, refs/tags/ and refs/remotes/
           will not be printed. If full is specified, the full ref name (including prefix) will be printed. If auto is specified, then if the output is
           going to a terminal, the ref names are shown as if short were given, otherwise no ref names are shown. The default option is short.

我还必须提到,在我的Git版本(2.20.1(上,分支将自动显示使用git log。您使用哪个版本的git?

最新更新