Using git-gui on Mac with Homebrew

15

2

I have Git installed with Homebrew.

However, git-gui doesn't seem to come stock in /usr/local/bin.

This answer suggests I should create an alias to usr/local/git/libexec/git-core/git-gui, but this file doesn't exist.

The only executable I can find is located in

/usr/local/Cellar/git/1.8.4/share/git-gui

Now this is the alias I used. However, if I ever update Git, I'll have to relink it.

How do I get a permanent reference to git-gui?

jonallard

Posted 2013-10-10T17:48:19.390

Reputation: 1 098

NB that you need git installed from hombrew (not the default) if you want git gui to work at all. For me, after doing that, git gui just works, no extra work needed... (Just run "git gui") FWIW – rogerdpack – 2014-12-15T16:52:54.653

1"I have Git installed with Homebrew." – jonallard – 2014-12-19T20:03:21.993

Answers

14

/usr/local/opt/ contains symlinks to the directories in /usr/local/Cellar/:

$ ll /usr/local/opt/git
lrwxr-xr-x  1 lauri  admin    19B Oct 11 17:07 /usr/local/opt/git -> ../Cellar/git/1.8.4
$ ll /usr/local/opt/git/libexec/git-core/git-gui
-rwxr-xr-x  2 lauri  admin   205B Sep 18 23:28 /usr/local/opt/git/libexec/git-core/git-gui

Check the file exists, then add something like this to ~/.gitconfig:

[alias] 
gui = !sh -c '/usr/local/opt/git/libexec/git-core/git-gui'

Lri

Posted 2013-10-10T17:48:19.390

Reputation: 34 501

2

Since version 2.25.0_1 of the git formula on Homebrew, the git gui functionality has been separated out into the git-gui formula. See the following pull request for background on this change: https://github.com/Homebrew/homebrew-core/pull/49136

Because of this, a better solution for to fix a broken git gui on a Homebrew-provided git install is to run:

brew install git-gui

Deniz Genç

Posted 2013-10-10T17:48:19.390

Reputation: 21