Linux HOWTOs

About | Home | Search


HOWTO: git
Description: Stupid Content Tracker/Fast Version Control System
Click here for ChangeLog
NOTE: I use GNU tar >= 1.13.25 so it's -j for .tar.bz2 files,
it's safe to assume that make, gcc, binutils, fileutils/coreutils, gawk, sed, and grep are prerequisites for almost everything


# Git 1.7.3.4
# ===========
# Slackware 12.0: git 1.5.2.2
# Slackware 12.1: git 1.5.5
# Slackware 12.2: git 1.6.0.3
# Slackware 13.0: git 1.6.4
# Slackware 13.1: git 1.7.1

# Prerequisites:
# autoconf (to create the configure script)
# zlib
# OpenSSL (optional)
# curl (optional)
# expat (optional)
# diff (optional but highly recommended)
# rcs' merge (required if you do development with Git)
# Tcl/Tk's wish (optional; for gitk)
# ssh (optional; if you need to push/pull remotely via ssh)
# Perl
# Python >= 2.3
# asciidoc/xmlto (to build and install the docs)

cd
test -f installed/git-1.7.3.4.tar.bz2 && mv installed/git-1.7.3.4.tar.bz2 .
test ! -f git-1.7.3.4.tar.bz2 &&
 wget http://www.kernel.org/pub/software/scm/git/git-1.7.3.4.tar.bz2

# Verify tarball w/ md5sum:
# (this came from my gpg-verified tarball)
echo "3a2602016f98c529cda7b9fad1a6e216  git-1.7.3.4.tar.bz2" | md5sum -c

# Verify tarball w/ sha1sum:
# (this also came from my gpg-verified tarball)
echo "8bda6668531fc41a72a680978798deb9ee048846  git-1.7.3.4.tar.bz2" | \
 sha1sum -c

# Verify tarball w/ gpg:
( gpg --list-keys 517D0F0E > /dev/null 2>&1 || gpg --recv-keys 517D0F0E ) &&
 wget -nc http://www.kernel.org/pub/software/scm/git/\
git-1.7.3.4.tar.bz2.sign &&
  gpg --verify git-1.7.3.4.tar.bz2.sign && rm -f git-1.7.3.4.tar.bz2.sign

mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "git-*" -exec rm -r {} \;
tar xjvf ~/git-1.7.3.4.tar.bz2
cd git-1.7.3.4
test $UID = 0 && chown -R root:root .

## You can do it this way:
# make prefix=/usr all doc info
# make prefix=/usr install install-doc install-html install-info
## or with autoconf:

# If there's no configure script, create it:
make configure

# My OpenSSL is installed in the standard source-installed location:
# /usr/local/ssl.  If yours was installed with a package (into /usr/bin,
# /usr/lib, etc.), you can probably leave off all of the "ssl" parts below
# and just run "./configure" and "make".
#
# If you have libiconv installed, you may also need to pass NEEDS_LIBICONV=1
# to make.
LDFLAGS=-L/usr/local/ssl/lib CPPFLAGS=-I/usr/local/ssl/include \
./configure --with-openssl=/usr/local/ssl
make

# Become root to install it
su

# Remove the Slackware package
test -x /sbin/removepkg && /sbin/removepkg git

# Install Git
# (If you used NEEDS_LIBICONV=1 above, you'll need it here too)
make install

# Rather than using asciidoc/xmlto to build documentation (make doc ; make
# install-doc), you can install the pre-formatted docs instead.
mkdir manual
cd manual
git init-db
git fetch-pack git://git.kernel.org/pub/scm/git/git.git man html |
 while read a b; do echo $a >.git/$b; done
cp .git/refs/heads/man .git/refs/heads/master
git checkout
cd ..
for mannum in 1 5 7; do \
  install -m 644 manual/man${mannum}/*.${mannum} /usr/local/man/man${mannum}/
done

# Make sure your non-root user can remove the source later
chown -R $USER .
chmod -R u+w .

# Become yourself again
exit

cd
mkdir -p -m 0700 installed
rm -f installed/git-*.tar.*
mv git-1.7.3.4.tar.bz2 installed/

Back to the list


Last updated: Tue, 07 Aug 2018 12:06:17 -0400
Jason Englander <jason at englanders dot us>