git gui not working after installing in Mac (e.g. Mountain Lion)

前端 未结 9 747
野趣味
野趣味 2021-01-30 02:07

When I ran git gui, I got this:

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

Did you mean one of these?
    grep
    init
    p         


        
相关标签:
9条回答
  • 2021-01-30 02:38

    You might need to install/upgrade separately the git-gui package after installing Mountain Lion.
    As mentioned in "Git GUI client for Linux", git gui has its own package (beside git-core).

    From the comments, it seems a git-gui package isn't yet available for Mountain Lion.
    However, this post report making work an alternative gui like Source Tree.
    That could be a good workaround.

    Source Tree App

    0 讨论(0)
  • 2021-01-30 02:40

    Edit your git config to an add an entry for gui in the alias section

    nano ~/.gitconfig
    

    [alias]

    gui = !sh -c '/usr/local/git/libexec/git-core/git-gui'

    Edit 2020

    It looks like the path in the original answer is now obsolete. Updated instructions:

    [alias]

    gui = !sh -c '/usr/local/opt/git/bin/git gui'

    0 讨论(0)
  • 2021-01-30 02:44

    Seems like in late 2017 all answers above got obsolete, so here's my new answer:

    brew install git
    /usr/local/opt/git/bin/git gui
    
    0 讨论(0)
  • 2021-01-30 02:47

    In addition to Victor's answer above, you need to an additional step, because brew install git didn't create simlink for git-gui.

    Inside /usr/local/bin, run the following:

    ln -s ../Cellar/git/1.8.3.2/libexec/git-core/git-gui git-gui

    (Replace git version with your own)

    0 讨论(0)
  • 2021-01-30 02:49

    I have the same issue. Git-gui appears still installed for me (/usr/local/git/libexec/git-core/git-gui is my location) but it doesn't just work without specifying the full path. This indicates a path issue, but I've not looked into it much further.

    edit Try adding /usr/local/git/libexec/git-core to the beginning of your PATH variable. Looks like all the git binaries are there so that should work.

    0 讨论(0)
  • 2021-01-30 02:50

    Adding to the path worked for me.

    I just added this line to my ~/.profile and git gui is alive once again. &(%ing mountain lion. export PATH=PATH:/usr/local/git/libexec/git-core

    0 讨论(0)
提交回复
热议问题