Git
有 git diff 顏色自定義
怎樣才能將
git diff
顏色更改為一個人的處置,或者例如為diff
…?在 ~/.gitconfig 中:
[color "diff"] added = yellow changed = red bold
不行。請真誠的幫助表示讚賞
手冊詳細說明了可用的
git-config(1)
插槽;您的added
andchanged
可能會改為new
andold
。color.diff.<slot> Use customized color for diff colorization. <slot> specifies which part of the patch to use the specified color, and is one of context (context text - plain is a historical synonym), meta (metainformation), frag (hunk header), func (function in hunk header), old (removed lines), new (added lines), commit (commit headers), whitespace (highlighting whitespace errors), oldMoved (deleted lines), newMoved (added lines), oldMovedDimmed, oldMovedAlternative, oldMovedAlternativeDimmed, newMovedDimmed, newMovedAlternative newMovedAlternativeDimmed (See the <mode> setting of --color-moved in git-diff(1) for details), contextDimmed, oldDimmed, newDimmed, contextBold, oldBold, and newBold (see git-range-diff(1) for details).