Links: Homepage | Downloads
Git is a distributed version control system that was initially designed and developed by Linus Torvalds for Linux kernel development. Every Git working directory is a complete repository with history and revision tracking capabilities.
Get the Code
/usr/local/src and download the source package.
cd /usr/local/src curl --remote-name http://git-core.googlecode.com/files/git-VERSION.tar.gz
Extract the archive and move into the folder.
tar -xzvf git-VERSION.tar.gz cd git-VERSION
Compile and Install
Configure, compile and install into
make configure ./configure --prefix=/usr/local/git-VERSION make all make install
Create a symbolic link that points
ln -s git-VERSION /usr/local/git
Git can be compiled with the Man Pages included but it requires dependencies that can be problematic. The maintainers are aware and therefore provide a pre-compiled version available for download.
/usr/local/src and download the documentation.
cd /usr/local/src curl --remote-name http://git-core.googlecode.com/files/git-manpages-VERSION.tar.gz
Extract the documentation to
mkdir -p /usr/local/git/man tar -xzvof git-manpages-VERSION.tar.gz -C /usr/local/git/man
Add the following lines to your Bash startup script to put Git and its Man Pages into your path.
echo 'export PATH=/usr/local/git/bin:$PATH' >> ~/.bash_profile echo 'export MANPATH=/usr/local/git/man:$MANPATH' >> ~/.bash_profile
Load the new shell configurations.
Verify the Installation
To verify that you have correctly installed Git, execute the following command. It should display git version VERSION.