2015-05-26 27 views
0

上的MacBook OS 10.7.5自制錯誤更新的git在Mac OS

我已經自制軟件安裝和更新更新混帳時,會出現以下問題。

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中

以防萬一,我將包括BREW醫生錯誤:

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. 

預先感謝任何提示或建議。

+0

你記得你做了更改後做'源.bashrc'? – crea1

+0

我還沒有,儘管似乎自制git版本位於其他地方。我運行git --version時未列出(Apple Git-XX) – pipebender

回答

1

在Mac上,蘋果爲您設置了apple-git,因此您需要將其刪除。運行以下命令來設置最新的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 
+0

。它只是說與上述相同。 – pipebender

+0

您是在Iterm中還是在默認終端中檢查它? – CodeWizard

+0

我正在使用終端。仍然顯示與上述相同的git和版本。也許python框架正在醞釀家庭?我能否將這些從.bashrc中移出並將其他位置重新定位?我需要一個.bash_profile文件嗎?我沒看到一個。 – pipebender