Compiling Git in Debian GNU/Linux


Git is a distributed version control system, originally conceived and developed by Linus Torvald. Git has a great reputation due to its robustness, flexibility and efficiency. The Git development team adds new features at very fast rate then if your distribution is not updated with the latest features of Git you can compile it from the source code.

Download git

$ wget


$ tar xJvf git-2.2.1.tar.xz 

Install dependencies

$ sudo bash -c 'apt-get -y install make autoconf gcc libssl-dev libcurl4-openssl-dev libexpat1-dev &&
apt-get install -y --no-install-recommends gettext' 

Configure and install

$ cd git-2.2.1 && ./configure --prefix=/usr/local/ --with-tcltk=no
$ make
$ sudo make install

Descargar e instalar las páginas man

$ wget
$ sudo tar xJv -C /usr/local/share/man -f git-manpages-2.2.1.tar.xz

The above command modifies permissions for /usr/local/share/man, so to see the manual you must run the following command:

$ sudo chmod a+rx -c /usr/local/share/man

The command above sets read and execute permissions for the /usr/local/share/man dir.

Install bash-git-prompt

bash-git-prompt offers details about repo in your shell prompt.

$ cd ~ && git clone .bash-git-prompt

Add to the .bashrc

# gitprompt configuration

# Set config variables first

# GIT_PROMPT_FETCH_REMOTE_STATUS=0   # uncomment to avoid fetching remote status

# GIT_PROMPT_START=...    # uncomment for custom prompt start sequence
# GIT_PROMPT_END=...      # uncomment for custom prompt end sequence

# as last entry source the gitprompt script
# GIT_PROMPT_THEME=Custom # use custom
# GIT_PROMPT_THEME=Solarized # use theme optimized for solarized color scheme
source ~/.bash-git-prompt/

Install git-completion.bash

git-completion.bash completes Git commands.

$ wget -O .git-completion.bash

We add to the .bashrc

source ~/.git-completion.bash

Now we can enjoy our powerful version control system

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.