如何使默认的git日志装饰 [英] How to make git log decorate by default

查看:72
本文介绍了如何使默认的git日志装饰的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我真正想要的是 git log --decorate 时,我经常输入 git log 。我怎么让它默认装饰?



我已经看到很多表单make an alias lg 的答案,然后输入 git lg 而不是git log。但是,我无法在任何地方找到如何更改git日志本身的默认行为。 alias log 不起作用。

解决方案

git config log.decorate auto



用于全局设置添加 - global param。



所以它会是 git config --global log.decorate auto



别名由 git config alias.lglog --decorate



编辑:基于VonC的回答,更新log.decorate true auto ,因为这是现在推荐的方式。


I frequently type git log when what I actually want is git log --decorate. How do I make it decorate by default?

I have seen lots of answers of the form "make an alias lg and then type git lg instead of git log". But, I can't find anywhere how to change the default behaviour of git log itself. alias log does not work.

解决方案

git config log.decorate auto

for global setting add --global param.

so it would be git config --global log.decorate auto

The aliases are made with git config alias.lg "log --decorate"

Edit: Updated log.decorate true to auto based on answer from VonC as this is now the recommended way of doing so.

这篇关于如何使默认的git日志装饰的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆