默认情况下如何使'git log'装饰 [英] How to make 'git log' decorate by default

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

问题描述

当我实际想要的是 git log --decorate 时,我经常键入 git log .我如何使其默认装饰?

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

我已经看到许多形式为创建别名 lg 然后键入 git lg 而不是git log"的答案.但是,我在任何地方都找不到如何更改 git log 本身的默认行为的地方.别名日志不起作用.

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

对于全局设置,请添加 --global 参数.

For a global setting, add the --global parameter.

应该是:

git config --global log.decorate auto

别名使用 git config alias.lg"log --decorate"

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

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