自制错误在mac os中更新git

时间:2015-05-26 21:49:09

标签: git macos upgrade homebrew

在macbook os 10.7.5

上更新git时会出现以下问题

我安装了自制软件并进行了更新。

which git        
/usr/local/git/bin/git
git --version 
git version 1.8.3.2
brew upgrade git 
ERROR: git 2.4.1 already installed

尝试包含

 export PATH=/usr/local/git/bin/git:$PATH 

在我的〜.bashrc文件中,仍然没有骰子。 此外,某些博客文章引用.bash_profile虽然我没有该文件,只是〜.bashrc

以防万一,我将包括酿造医生的错误:

Warning: /usr/local/sbin isn't writable.

This can happen if you "sudo make install" software that isn't managed by Homebrew.
If a formula tries to write a file to this directory, the install will fail during
 the link step.

You should probably `chown` /usr/local/sbin

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use 
when compiling and linking.

Having additional scripts in your path can confuse software installed via Homebrew 
if the config script overrides a system or Homebrew provided script of the same 
name. We found the following "config" scripts:

  /Library/Frameworks/Python.framework/Versions/Current/bin/python-config
  /Library/Frameworks/Python.framework/Versions/Current/bin/python2.5-config/usr/local/rvm/gems/ruby-1.9.3-p194/bin/passenger-config
/opt/sm/pkg/active/bin/curl-config
  /opt/sm/pkg/active/bin/ncurses5-config
  /opt/sm/pkg/active/bin/ncursesw5-config
  /opt/sm/pkg/active/bin/pkg-config
  /opt/sm/pkg/active/bin/xml2-config
  /opt/sm/pkg/active/bin/xslt-config

Warning: Python is installed at /Library/Frameworks/Python.framework

Homebrew only supports building against the System-provided Python or a 
brewed Python. In particular, Pythons installed to /Library can interfere
with other software installs.

Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:

iftop

Warning: You have a non-Homebrew 'pkg-config' in your PATH:
  /opt/sm/pkg/active/bin/pkg-config

`./configure` may have problems finding brew-installed packages using
 this other pkg-config.

提前感谢任何提示或建议。

1 个答案:

答案 0 :(得分:2)

在Mac上为你设置apple-git,所以你需要删除它。运行以下命令来设置最新的git版本。

brew install git

git --version
git version XX.XX.XX (Apple Git-XX)
which git
       ...
// doh! osx's pre-installed git trumps the brew one, so:
sudo mv /usr/bin/git /usr/bin/git-apple
which git
    /usr/local/bin/git
git --version
    git version 2.X.X