---
title: "Git “Command not found” Error in Mountain Lion [Quickfix]"
author: "janedoneway"
date: "2012-10-29T09:28:23Z"
tags: []
categories: ["操作系统"]
slug: "git-command-not-found-error-in-mountain-lion-quickfix"
draft: false
lastmod: "2012-10-29T09:28:23Z"
id: 1707086
url: "https://janedoneway.iteye.com/blog/1707086"
---

From: http://www.tuicool.com/articles/uIR7Zf

 

Exploring the new Mountain lion can be exciting, especially when you are trying to [find out what the latest Mac OS X has to offer](http://www.hongkiat.com/blog/mountain-lion-features/) . But if you are a web developer who used GIT in your previous OS, you may be prompted with the following error message:

" **-bash: git: command not found** " 

when you try executing the `git` command in your Terminal.

![git not found](http://img0.tuicool.com/3YVJBz.jpg)

Don’t worry, here’s how you can fix this very quickly in just two steps.

#### Step 1

Launch the App Store then download " **Xcode** ".

![install xcode](http://img1.tuicool.com/fqYVVv.jpg)

#### Step 2

Install Xcode, run it and go to Xcode’s preference via shortcut key Command + ,

Go to the **Downloads** tab, look for " **Command Line Tools** ", and click **Install** .

![install command line tools](http://img2.tuicool.com/EBziQz.jpg)

You may be required to enter an Apple Developer ID. If you don’t have an account, just register for one.

![login with apple id](http://img0.tuicool.com/eEfE7z.jpg)

#### Step 3

We kid. That’s it. Once the Command Line Tool is installed, quit and re-open Terminal, hit the `git` command and see if it has been successfully reinstated.

![test git in terminal](http://img1.tuicool.com/nMnAr2.jpg)

* * *

分享到： [新浪微博]() [腾讯微博]() [QQ空间]() [人人网]() [更多](http://www.jiathis.com/share?uid=901359) [0]()