Installing Git on Red Hat Enterprise LinuxEdit

For my Red Hat Git install I opted for a simpler, no-documentation installation (for notes on installing the documentation see "Installing Git on Mac OS X Tiger"). Note that although Red Hat Enterprise Linux already has a copy of the Expat library installed (in /usr/lib/) I decided to download the latest version and install it under /usr/local/lib/.

# get source for Expat dependency from:

# extract
tar xzvf expat-2.0.1.tar.gz
cd expat-2.0.1

# build
make check
sudo make install

# grab the source from the Git homepage:

# extract source
tar xjvf git-
cd git-

# build
make prefix=/usr/local all

# run tests
make prefix=/usr/local test
echo $?

# install
unset CDPATH
sudo make prefix=/usr/local install

My first attempt at installing didn’t work because of a period in my CDPATH environment variable; to avoid such problems in the future I unset the variable and removed the corresponding export from my ~/.bash_profile (CDATH should be set via normal assignment only and not exported).

See also