gitk will not start on Mac: unknown color name "lime"

Gitk

Gitk Problem Overview


I've installed git on a mac via brew install git. When I try to start gitk I get the following error:

Error in startup script: unknown color name "lime"
    (processing "-fore" option)
    invoked from within
"$ctext tag conf m2 -fore [lindex $mergecolors 2]"
    (procedure "makewindow" line 347)
    invoked from within
"makewindow"
    (file "/usr/local/bin/gitk" line 12434)

It appears that my Mac doesn't have a color named lime.

Can I add a lime color to the environment, or is there a better fix?

The git version is 2.7.0, and the Mac is running Yosemite 10.10.5

Gitk Solutions


Solution 1 - Gitk

You can check your version of Tcl/Tk by running wish and using the command info patchlevel. It appears that git 2.7.0, Tcl/Tk 8.5.9, and OS X 10.11 El Capitan do not work well together.

I solved this problem by doing brew cask install tcl, which installed 8.6.4, and gitk works now.

Solution 2 - Gitk

I also found the same problem with exactly the same version of git and OSX. As a temporary workaround I suggest you to do the following:

cp /usr/local/bin/gitk /usr/local/bin/gitk.bkp
vi /usr/local/bin/gitk

and replace all occurences of lime to any color you want (I used #99FF00). Here is the vim command:

:%s/lime/"#99FF00"/g

EDIT: Please follow Keith B answer for permanent fix.

Solution 3 - Gitk

@Konrad Thanks for the help!! Although the answer is correct, please be aware that your command

:%s/lime/"#99FF00”/g

contains two different quotation marks, which will def. throw an error if copied & pasted.

So in order to go through with it, I had to do:

cp /usr/local/bin/gitk /usr/local/bin/gitk.bkp
vi /usr/local/bin/gitk

And inside vim:

:%s/lime/"#99FF00"/g

Solution 4 - Gitk

If you don't want to use Caskroom, follow this:

$ brew install tcl-tk
$ brew link tcl-tk --force

Solution 5 - Gitk

I was face same issue in ubuntu system. Then i flow below step to resolve issue.

  1. open /usr/bin/gitk file in any text editor

  2. search 'lime' keyword in file

  3. replace 'lime' to 'green' with all in file

  4. save file changes

  5. try again gitk then it works

Solution 6 - Gitk

Useful addition to the good answers suggesting replacing all occurrences of the word "lime" by the word "green" in the file /usr/bin/gitk or /usr/local/git/bin/gitk:

The replacement of occurrences of "lime" in the above "gitk" file is sometimes not enough.

You also need to do the same replacement process on the file ~/.config/git/gitk, or remove that file.

Solution 7 - Gitk

I am running MAC with Yosemetti and followed the below steps to resolve.

open /usr/local/git/bin/gitk file in any text editor

search 'lime' keyword in file

replace 'lime' to 'green' with all in file

save file changes

try again gitk then it works

Thanks @kaushal sharma, followed your answer, with a change in the gitk path.

Solution 8 - Gitk

Follow the instructions above, but additionally do the following:

before running vi: chmod +w /usr/local/bin/gitk

after closing vi: chmod -w /usr/local/bin/gitk

Solution 9 - Gitk

Make sure, your path is set correctly when trying Keith B's solution. Running brew doctor showed, that I had /usr/bin before /usr/local/bin.

~ $ brew doctor
...
Consider setting your PATH so that /usr/local/bin
occurs before /usr/bin. Here is a one-liner:
  echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.bash_profile

Solution 10 - Gitk

Thanks Konrad ,It work for me with below step

  1. sudo brew update
  2. sudo brew cask install tcl
Categories

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionReggieBView Question on Stackoverflow
Solution 1 - GitkKate BertelsenView Answer on Stackoverflow
Solution 2 - GitkKonradView Answer on Stackoverflow
Solution 3 - GitkLukarsView Answer on Stackoverflow
Solution 4 - GitkmeritoView Answer on Stackoverflow
Solution 5 - Gitkkaushal sharmaView Answer on Stackoverflow
Solution 6 - GitksdiveView Answer on Stackoverflow
Solution 7 - GitkVenuView Answer on Stackoverflow
Solution 8 - GitkriscvView Answer on Stackoverflow
Solution 9 - GitkklettersteinView Answer on Stackoverflow
Solution 10 - Gitkuser1665785View Answer on Stackoverflow