问题描述
在制作我最喜欢的git log视图时,我创建了这个别名:
graph = log --pretty = format:'%Cgreen %广告%CRESET%C(黄色)%H%CRESET%C(黄色)%d%CRESET%S%C(青色)[%的]%CRESET%Cgreen(%AR)%CRESET --date =短 - -graph
这会创建一个输出:
我在这里错过的是不同颜色的分支类型如 log --oneline --decorate --graph
。
-decorate(默认使用= short)为不同的识别分支提供不同的颜色。分支类型(HEAD,origin / master,origin / HEAD,master)
为青色,红色,红色,绿色。然而,我的是无色的;只用整个分支部分的黄色着色。
有没有办法给不同的种类的分支提供不同的颜色有自己的别名? https://stackoverflow.com/a/16844346/55948
In making my favorite git log view I've created this alias:
graph = log --pretty=format:'%Cgreen%ad%Creset %C(yellow)%h%Creset%C(yellow)%d%Creset %s %C(cyan)[%an]%Creset %Cgreen(%ar)%Creset' --date=short --graph
This creates an output like:
What I'm missing here is the different coloring of branch types like in log --oneline --decorate --graph
.
The --decorate (which uses =short by default) gives the different recognized branches a different color. The branch types (HEAD, origin/master, origin/HEAD, master)
are colored cyan, red, red, green. Mine however are uncolored; colored only with the yellow of the whole branches part.
Is there a way to give different colors to the different kind of branches with an own alias?
Per https://stackoverflow.com/a/16844346/55948
这篇关于如何模拟git log - 为每个分支类型设置不同的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!