Installing git from source on mac os/x

by , under scm

As usual i need control. So i’m going to install the git from source. It is pretty straightforward just like any other installation from source.

1. Download the source from here.
2. My habit is store all the source under /usr/local/src.
[sourcecode language=”bash”]
cd /usr/local/src
[/sourcecode]
3. Now extract the source into the /usr/local/src directory assuming that your tar file is in downloads folder.
[sourcecode language=”bash”]
tar -xzvf ~/Downloads/git-x.x.x.x.tar.gz
[/sourcecode]
4. cd into the extracted folder.
[sourcecode language=”bash”]
cd git-x.x.x.x
[/sourcecode]
5. Build it. I like this to be installed into /usr/local/ directory others prefer /opt/
[sourcecode language=”bash”]
make prefix=/usr/local/git
[/sourcecode]
5. Install it.
[sourcecode language=”bash”]
sudo make install prefix=/usr/local/git
[/sourcecode]

I’m used to using cheat sheets and don’t need man pages. If you need the git man pages then please see here on how to install it.

Leave a Reply