Git on Mac OS X Lion

Possible duplicate:
Git not found after installing OS X Lion

I just upgraded my mac to LION and now git is gone:

$ git -bash: git: command not found 

Any ideas on how to get git back?

+80
git osx-lion macos
Jul 24. 2018-11-21T00:
source share
6 answers

The default installation location is / usr / local, so add this to your ~ / .bash_profile file

export PATH=$PATH:/usr/local/git/bin/

then run source ~/.bash_profile in terminal

+150
Jul 24 2018-11-21T00:
source share

If you do not want to install Xcode and / or the / fink / homebrew ports, you can always use the standalone installer: http://code.google.com/p/git-osx-installer/

+15
Jul 25 '11 at 9:40
source share

you need to find where git is, then add the folder to your PATH variables in .bash_profile.

Using terminal:

1) find git:

 sudo find / -name git 

2) edit the .bash_profile add file

 PATH="<DIRECTORY OF GIT>:$PATH" 

Git is back :-)

In any case, I suggest you install git using macports, so you can easily upgrade your git to the latest version

Hope this helps

+7
Jul 24 2018-11-21T00:
source share

There are several points to this question.

Firstly, you do not need to install Xcode. Git installer works fine. However, if you want to use Git from Xcode - it expects to find the installation in / usr / local / bin. If you have your own Git installed elsewhere, I have a script that fixes this.

Secondly, this is the way to go. My Git path was used under /etc/paths.d/ . However, installing Lion overwrites the contents of this folder and the /etc/paths file. What happened to me and I got the same error. Resuming the path file fixes the problem.

+7
Jul 25 2018-11-11T00:
source share

This is part of Xcode. You will need to reinstall the developer tools.

+4
Jul 24 2018-11-21T00:
source share

You can always use port

+1
Jul 24 2018-11-21T00:
source share



All Articles