开发者

Is there a way to colorize the git add --interactive mode?

I am using git add --patch a lot and I am looking for a way to have its output colorize (like in git diff --color).

Is there something out the开发者_如何转开发re or should I try and write a wrapper?


In your .gitconfig:

[color]
    interactive = true

I'm not sure exactly how this will get colorized, but that's the builtin option.


You could run it through Perl or somesuch and inject colour codes


The problem with adding 'ui = true' to the config file is that it impacts other commands. For example, if you use 'git diff file.c > patch" to save patch files, the escape codes that make the color might end up in the output file.

Other options are to do it the command line:

git -c color.ui=true add -p foo.c

or, make an alias in the .git/config file:

[alias]
  addp  = -c color.ui=true add -p
  addi  = -c color.ui=true add -i
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜