Question: I just upgraded my Mac to [Mac OS X v10.7](https://en.wikipedia.org/wiki/Mac_OS_X_Lion) (Lion), and now Git is gone:

```
$ git
-bash: git: command not found

```

How can I get Git back?

Answer: 
The default install 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.
There are a couple of points to this answer.

Firstly, you don't need to install Xcode. The Git installer works perfectly well. However, if you want to use Git from within Xcode - it expects to find an installation under /usr/local/bin. If you have your own Git installed elsewhere - I've got [a script](https://gist.github.com/774277) that fixes this.

Second is to do with the path. My Git path used to be kept under `/etc/paths.d/` However, a [Mac OS X v10.7](https://en.wikipedia.org/wiki/Mac_OS_X_Lion) (Lion) install overwrites the contents of this folder and the `/etc/paths` file as well. That's what happened to me and I got the same error. Recreating the path file fixed the problem.