dstandish
dstandish

Reputation: 2408

how to enable color highlighting for interactive git rebase on mac

Color highlighting works for everything else in git (e.g. status, log, branch name etc). Just not when I do an interactive rebase.

This sort of makes sense because interactive rebase happens within a text editor, where other interactions are just terminal output. But I think I remember highlighting working by default in git bash on windows, so there must be a way on mac.

I would like it to color code pick vs squash vs fixup etc.

As a shot in the dark, I tried setting color param interactive to true and auto in my ~/.gitconfig, and tried supplying some color values explicitly, but this had no effect:

[color]
    branch = auto
    diff = auto
    status = auto
    ui = auto
    interactive = true
[color "interactive"]
    pick = yellow
    squash = green
    fixup = cyan

Upvotes: 8

Views: 1451

Answers (1)

jingx
jingx

Reputation: 4014

The highlighting in an editor is not controlled by git's configuration. Highlighting works by default in git bash because it comes with a vim pre-configured with git syntax files.

Assuming you are using vim for the git editor on mac, first try enabling vim syntax highlighting by adding syntax on to ~/.vimrc.

Failing that, you may need to download and install git syntax files.

Upvotes: 9

Related Questions