git中的颜色和作者登录Windows?

git中的颜色和作者登录Windows?,windows,git,git-log,Windows,Git,Git Log,使用Windows10Pro 64位,我发现了一个很好的命令来列出Git历史记录,将头、分支和标记显示为突出的颜色。很好 git log --oneline --decorate --graph --all 但我没有看到任何日期或作者!所以我找到了另一个很好的命令: git log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short 也很好--现在我可以看到日期和作者了。但是除了图形,所有漂亮的颜色都消失了。头部、分支和标

使用Windows10Pro 64位,我发现了一个很好的命令来列出Git历史记录,将头、分支和标记显示为突出的颜色。很好

git log --oneline --decorate --graph --all
但我没有看到任何日期或作者!所以我找到了另一个很好的命令:

git log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
也很好--现在我可以看到日期和作者了。但是除了图形,所有漂亮的颜色都消失了。头部、分支和标记的颜色都与原木的其他部分相同,因此很难将其识别出来


如何在保留日期和作者的同时恢复提交指针的颜色?

这应该满足您的要求:

git log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
添加git log-decoration-graph,它将显示分支、标记等

-装饰

打印显示的任何提交的引用名称。如果指定了short,则不会打印ref名称前缀refs/heads/、refs/tags/和refs/remotes/。如果指定了full,则将打印包含前缀的完整ref名称。默认选项是short

-图表

在输出的左侧绘制提交历史的基于文本的图形表示。这可能会导致在提交之间打印额外的行,以便正确绘制图形历史记录

窗户 格式:

format:format允许您指定要显示的信息。它的工作原理有点像printf格式,但值得注意的例外是,您得到的换行符是%n,而不是\n


例如,格式:%h的作者是%an,%ar%n标题是>>%s但我没有日期。我知道如何添加它们,但是所有的分支指针都是相同的颜色,不同于git log-oneline-decoration-graph-all。我更改了条目以添加日期,分支颜色应该是固定的。
The author of fe6e0ee was Junio C Hamano, 23 hours ago
The title was >>t4119: test autocomputing -p<n> for traditional diff input.<<
# print out the git log
git log 

# print out the branches split and merge points
--graph 

# use the --pretty=format:... to choose which data to extract from the log
# (commit) entry and print it out.

# Set colors with the %C<color> & %Creset for resetting back to the default color