How do git upgrade under mac os x windows?

107 2

Mac os x uses which git to view git discovery in the /usr/bin/git directory, which may be installed together when I talling xcode, and the version is 1.7.5.4.

If you want to upgrade to a new version, download the git-osx-installer Choreographer installation, and check it out on the command line that's still an older version, and discover that this installation package is installing git under directory.

I'm going to use this new version of git, and ask how to set it, or there's another way to do it.

9 Answers

68 3
cd/usr/bin
mv git git_legacy_1.7.5.4
ln -s/usr/local/git./
117 3

It's two problems.
A high version of git how to install?
I can use git-osx-installer, with brew.
I recommend using brew I & tallation:
brew install git

Another is how to make the new git cover the old git?
It's recommended that you modify ~/. Bash_profile to add the following:
export PATH=/usr/local/bin:/usr/local/sbin:${PATH}
This allows bash to take precedence over the instructions under usr local and don't overwrite the old files.

85 0

I've also updated my git. It's easy to update with homebrew.
If you've homebrew,

brew install git

My practice is:
After update

sudo cd/usr/bin
sudo mkdir old-git-1.7.5.4
sudo mv git* old-git-1.7.5.4

The benefit is that other components of git are up to date. And when git finishes, there's no old git.

142 3
116 5
56 0
150 5
...