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
# ===========
# Slackware 12.0: git
# Slackware 12.1: git 1.5.5
# Slackware 12.2: git
# 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)

test -f installed/git- && mv installed/git- .
test ! -f git- &&

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

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

# Verify tarball w/ gpg:
( gpg --list-keys 517D0F0E > /dev/null 2>&1 || gpg --recv-keys 517D0F0E ) &&
 wget -nc\
git- &&
  gpg --verify git- && rm -f git-

mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "git-*" -exec rm -r {} \;
tar xjvf ~/git-
cd git-
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

# Become root to install it

# 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:// 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}/

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

# Become yourself again

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

Back to the list

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