我想知道是否有人有技巧可以在合并或变基时对冲突的输出进行着色。
我想特别着色显示带有文件名的那一行,例如这里的第二行:
编辑:
使用 git 别名和 bash 函数,我可以编写以下内容:
Auto-merging CMakeLists.txt
CONFLICT (content): Merge conflict in CMakeLists.txt
Failed to merge in the changes.
感谢。编辑:
使用 git 别名和 bash 函数,我可以编写以下内容:
color-merge = "!f() { git merge --no-commit --stat $1| egrep --color 'CONFLICT .*|$'; }; f"
这会着色所有冲突的行,但是:
- 无法更改传递给合并的选项
- 在要跟踪的分支上没有完成
所以我正在寻找更强大的东西。
干杯
git config --global color.ui auto
?! - Lazy Badger