Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Xcode 4 install git?

I bought a new MacBook Pro and installed the applications list below in order. On my old MacBook, also running OS X 10.6.6, I didn't have /usr/bin/git, however, on the new MacBook Pro, I do. The only differences that I can think of between the two systems are:

  1. New MacBook Pro has Xcode 4 vs. Xcode 3 on old MacBook
  2. New MacBook Pro installed git using homebrew vs. old MacBook installed [git-osx-installer][]

Homebrew installed git 1.7.4.1 into /usr/local/Cellar/git and symlinked it into /usr/local/bin. This leads me to believe that Xcode 4 installed git 1.7.3.4 into /usr/bin. Can anyone confirm or deny this?

If Xcode 4 didn't install git 1.7.3.4 into /usr/bin, any thoughts what program did?

Applications Installed in Order

  • First boot
  • Ran Apple's Software Update
  • Ran Bootcamp to create 48GB NTFS partition for Windows 7
  • Installed iWork '09 and ran software update to install iWork Update 5
  • Installed TextExpander 3.2.4
  • Installed Dropbox 1.0.20
  • Installed 1Password 3.5.9
  • Installed Alfred 0.8.2 (107)
  • Installed Adium 1.4.1
  • Started installation of Xcode4 via App Store
  • Installed Caffeine 1.1.1 via App Store
  • Installed Kindle via App Store
  • Completed installation of Xcode 4 via App Store
  • Installed Homebrew using the following command: ruby -e "$(curl -fsSLk https://gist.github.com/raw/323731/install_homebrew.rb)"
  • Installed git using brew install git
  • Installed MacVim using brew install macvim

Update: Package Receipt Info

I ran pkgutil --file-info /usr/bin/git and the following info was displayed. This appears to incriminate Xcode 4.

volume: / path: /usr/bin/git  pkgid: com.apple.pkg.GitLeo pkg-version: 4.0.0.9000000000.1.1248867338 install-time: 1300459157 uid: 0 gid: 0 mode: 755 

Why It's a Problem that Xcode 4 Installs git

By default, the path /usr/local/bin is after /usr/bin (see the file /etc/paths). This means that git 1.7.3.4 is used instead of 1.7.4.1 that Homebrew installed.

like image 594
Matthew Rankin Avatar asked Mar 19 '11 19:03

Matthew Rankin


People also ask

Does Xcode include Git?

Xcode will create your new project along with a new Git repository. All source control systems, including Git, store their data into a repository so that they can manage your project versions and keep track of changes throughout the development cycle.

Does Mac come with git installed?

Git can be installed on the most common operating systems like Windows, Mac, and Linux. In fact, Git comes installed by default on most Mac and Linux machines!

Does Apple come with Git?

Apple ships a binary package of Git with Xcode.


1 Answers

Yes, it does. I just finished the Xcode 4 install. git was previously installed to /usr/local/git.

I am new to OS X, and can only suggest swapping the order of those directories in /etc/paths.

Not sure what else would/might work.

like image 97
Guy Allard Avatar answered Sep 20 '22 21:09

Guy Allard