Compiling Git in Debian GNU/Linux

git

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 https://www.kernel.org/pub/software/scm/git/git-2.2.1.tar.xz

Unpack

$ 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 https://www.kernel.org/pub/software/scm/git/git-manpages-2.2.1.tar.xz
$ sudo tar xJv -C /usr/local/share/man -f git-manpages-2.2.1.tar.xz

Install bash-git-prompt

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

$ cd ~ && git clone https://github.com/magicmonty/bash-git-prompt.git .bash-git-prompt

Add to the .bashrc


# gitprompt configuration

# Set config variables first
GIT_PROMPT_ONLY_IN_REPO=1

# 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-colors.sh
# GIT_PROMPT_THEME=Solarized # use theme optimized for solarized color scheme
source ~/.bash-git-prompt/gitprompt.sh

Install git-completion.bash

git-completion.bash completes Git commands.

$ wget https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -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 *