Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a non-sudo account on a shared host. I want to be able to run the git-core for version control. I have another server that I am using for the git-repo.

How can I install a version of git inside of my user folder and execute that.

I have shell access and the server is CentOS/Redhat/Fedora.

share|improve this question

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 The most recent release is, so you would get git- You may also want git-manpages- and/or git-htmldocs- There are .gz versions available if you can not uncompress .bz2 files.

Git’s 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"

The 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 Makefile directly.

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
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.