Did Apple remove the 'git gui' command in Xcode 4.5 command line tools?
Asked Answered
S

3

20

After updating to Xcode 4.5 and installing the developer tools I can no longer run the 'git gui' command from the command line. It says:

$ git gui
git: 'gui' is not a git command. See 'git --help'.

I'm running this version:

$ git --version
git version 1.7.10.2 (Apple Git-33)

Searching the git docs (http://git-scm.com/docs/git-gui) shows 'git gui' should be available, and hasn't changed since version 1.7.7. So did this Apple version of git remove this command? I use it all the time!

Subclimax answered 1/10, 2012 at 5:32 Comment(2)
Maybe you need an xcode-select, as described in cocoanetics.com/2012/07/… ?Windpollinated
Thanks for the tip. I was a little nervous about running the script to completely remove XCode command line tools. It would probably work, but I couldn't undo it if something went wrong, so I went with the solution below.Subclimax
S
27

Apple did indeed remove the 'git gui' command, probably because they were removing X11 which 'git gui' is based on.

I decided to just homebrew git instead of relying on the Xcode command line tools.

brew install git

Then I edited the /etc/paths file to have the /usr/local/bin directory come before the /usr/bin directory, because that wasn't right either. Then exited the terminal window and restarted, and now I get:

$ which git
/usr/local/bin/git

$ git --version
git version 1.7.12.1

and the git gui command works again.

Subclimax answered 2/10, 2012 at 3:51 Comment(1)
"Apple did indeed remove the 'git gui' command"? Good to know.Windpollinated
R
1

This worked for me

sudo vi ~/.gitconfig

[alias]
gui = !sh -c '/usr/local/git/libexec/git-core/git-gui' 
Rowenarowland answered 4/10, 2016 at 10:39 Comment(0)
D
1

this is an old question - on newer systems, see git gui not working after installing in Mac (e.g. Mountain Lion) I'm on Big Sur, but apart from the paths used and symlinking new git, the instructions were the same.

I used homebrew to install git & git-gui, then symlinked git to my local bin to make sure it used that over the Apple version.

gitk is part of the git-gui package.

brew install git

brew install git-gui

close all terminal windows and open a new one (I used a symlink until I realised I had other terminal windows open that were messing with my $PATH)

check version and paths:

which git 
which git-gui
git --version
Deprivation answered 13/10, 2021 at 14:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.