20 Jan 2012

Using a custom version of Git on Mac OS X Lion


If you're using git-osx-installer to install Git on Mac OS X Lion, and 'git --version' in Terminal isn't displaying the version you've just installed, then your system is using the version of Git that's provided by Xcode Developer Tools.

To use the git-osx-installer version that you've just installed, you'll need to edit the /etc/paths file and add "/usr/local/git/bin" to the top of that file.

To open the file for editing, type sudo nano /etc/paths in Terminal.  Add the "/usr/local/git/bin" line to the top of the file.  To write the file, and exit nano after making that change, type Control-O then Control-X. To allow the change to take place, you'll need to quit Terminal, then open it back up again.

git --version should now report the newly installed git-osx-installer version of Git.

Tags

developer-tools development git lion mac mac-os mac-os-x nano os-x terminal xcode xcode-developer-tools

Related Posts

15 Jun 2012 How to add auto-completion to git
16 Oct 2009 Holyoke's Center City Vision Plan
26 Jan 2012 View the changes between two branches of a git repository in SourceTree
28 Dec 2012 How to make SublimeLinter work with Ruby & RVM
04 Nov 2009 Some Fantastic Mac And iPhone Applications