If you have access to the compiler, you should be able to download the source archive, build it, and install it in your home directory.
You can get a source archive from http://www.kernel.org/pub/software/scm/git/. The most recent release is 220.127.116.11, so you would get
git-18.104.22.168.tar.bz2. You may also want
git-htmldocs-22.214.171.124.tar.bz2. There are
.gz versions available if you can not uncompress
Makefile actually defaults to installing in your home directory. If you already have a well populated
~/bin (etc.) and you want to install Git separately, then you can have it install everything under a some other “prefix” in your home directory. Using a unique prefix also makes it easy to uninstall or wipe and upgrade.
make install prefix="$HOME/git"
Makefile has many comments describing the variables that control the build process. It also includes reasonable defaults for most platforms. You can tweak any of the settings by editing the file itself or putting your customizations in a
config.mak file (it is automatically included if it exists).
Unless you are on an exotic system, you can skip using
./configure. The autoconf stuff works, but sometimes it rusts a bit since most of Git’s developers just use the
If you do not have access to the compiler on your target machine, then you will need access to a machine with a similar OS installation. Build with
prefix set to the path that will be used on the target machine and set
DESTDIR to a temporary location (on the build machine).
# On the "build" machine:
make install prefix=/home/dir/on/target/git DESTDIR=/tmp/git-dest
cd /tmp/git-dest/home/dir/on/target && tar cjf git-for-target.tar.bz2 git
# transfer the file to "target" machine
# On the "target" machine:
cd /home/dir/on/target && tar xjf git-for-target.tar.bz2