简体   繁体   中英

Install or not Git on Mac OS

I have a Mac OS X Version: 10.8.2 with Xcode 4.5.2.

I'm going to use git and I'm not sure if I have to install it or not.

Searching on my computer, I've found it here: /Applications/Xcode.app/Contents/Developer/usr/bin/git

If it's needed I going to install this distribution . Is this the right one?

Is it necessary to install Git or can I use the one who comes with Xcode?

You only need to install a newer version of git if the one that comes with Xcode doesn't support a feature you want, or, of course, fixes a bug.

You need to install the Xcode Command Line package, in order access things like git from the standard path ( /usr/bin ). You can do that within Xcode itself.

If you need to install a newer version of git, I would recommend the Macports version.

I rarely use the command line version of git on my Mac, preferring to do complex source control operations using the excellent, and free, Atlassian SourceTree app.

You can, however, do note, it's an older version than the distribution. Personally, I use homebrew 's version of git.

If you use Xcode and have no plan to uninstall Xcode 4.5.2 (or newer), then git is already available to you. The only thing is the git version bundled inside Xcode may not be the latest. Another thing is to use git (bundled inside Xcode) from the console or Terminal.app, then you'll need to prefix your command with

xcrun

See the man page for more detail.

On the other hand, if you want to use git without requiring Xcode, then download the git source, and build using the makefile will allow you to customize git to your needs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM