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:
- New MacBook Pro has Xcode 4 vs. Xcode 3 on old MacBook
- 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 fol开发者_如何学Clowing 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.
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.
Under Preferences, Downloads there was an option for Command Line Tools. I installed that and it worked well.
I just looked into this and found git in /Applications/Xcode.app/Contents/Developer/usr/bin
after installing Xcode from the App Store on 10.7.4. Adding that directory to my PATH
seems to have done the trick.
I had to install the command line tools. Here's a helpful answer https://github.com/mxcl/homebrew/issues/10244#issuecomment-4013781
Xcode 4 installs git at /Developer/usr/bin and at /usr/bin. Xcode 4 uses the version at /Developer/usr/bin. I believe Xcode 4 also invokes git with a full path, so changing the path variable won't change the version of git being used by Xcode 4 itself. Of course, if you are just using git outside of Xcode, none of this matters.
I have been dealing with that same problem. Since I added the new default push style to my git command several programs have been failing because they were still using some internal old version of git.
I think I gave a good temporal solution here:
https://apple.stackexchange.com/a/72524/26545
精彩评论