Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialCaleb Sanchez
12,943 PointsUpdating Pre-installed version of Git on mac
Mac comes with Git already loaded into the operating system. My current version is 1.8.5.2, but Git is actually at version 2.0.2 or something close to that.
When I use the "which git" command, I see that git is located in usr/bin/git.
I then installed macports and have installed Git, but it's putting it into a new place. /opt/local/bin/git. So it's clearly in a new place. But when I check the version I get the same as before. H
How do I update Git with macports? Do I have to supply a $PATH to my .profile?
2 Answers
Stone Preston
42,016 Pointsyes /opt/local/bin needs to be in your path.
open your your bash_profile in a text editor (im using sublime in this case)
$ cd ~
$ subl .bash_profile
add the directory to your path variable in that file
export PATH=~/opt/local/bin:$PATH
in this case you want to add it to the front of your path variable. if you add it to the end then the default git version would be used since it would be found first
Asjer Querido
6,016 PointsInstall Git with Homebrew, easiest way to maintain your Git installation (and more):
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
Follow the script and then install Git with Homebrew:
brew install git
Lee Stetson
16,944 PointsLee Stetson
16,944 PointsIs there any sense to keeping the old version of Git active on our computers? I mean, all this does is install a newer version and tell our computer to look at the newer version first. With a program like Git, I have trouble seeing an instance where we would ever need to use the old copy.
Obviously, this question would extend to lots of other software on the computer (e.g., I have countless versions of Python installed, but really only use the latest of 2.x or 3.x, despite having several versions of 2.x installed). But I guess just an answer in the context of Git would work fine.