How to set --quiet flag by default in git?

时间:2017-10-12 10:05:23

标签: linux git command-line configuration

The git output is very verbose for me. How can I set --quiet flag by default to all commands in git?

EDIT: I have to use this -q mode in git jenkins plugin. I can't use alias, redirect to dev/null.

2 个答案:

答案 0 :(得分:1)

您无法在gitconfig中为所有命令设置quiet标志。作为@torek mentioned,无法将内置命令设置为别名。所以设置你的别名,因为它们对你来说更方便。

[alias]
    commitq=commit --quiet
    commit-quiet=commit --quiet
    pushq=push --quiet
    st=status -s
    ...

答案 1 :(得分:0)

不,似乎没有'git config'设置来设置所有命令在安静模式下运行 - https://git-scm.com/docs/git-config

如果您经常使用一组git命令,可能在shell配置中添加别名以运行带有-q选项的别名?