Build Git

Linux vcs git

My problem

I want to have an up to date git on my Linux system ( currently KDE neon )

My solution

I wrote a little script installing the prerequisites, downloading the sources, compiling and installing:

#! /bin/bash

GIT_VERSION=2.14.2

cd ~
rm -rf ~/tmp/git
mkdir -p ~/tmp/git
sudo apt install unzip automake gcc libssl-dev build-essential libcurl4-gnutls-dev libexpat1-dev gettext curl -y
cd ~/tmp/git
wget https://github.com/git/git/archive/v$GIT_VERSION.zip
cd ~/tmp/git
unzip v$GIT_VERSION.zip
cd git-$GIT_VERSION
make prefix=/usr/local all
sudo apt remove git -y
sudo apt autoremove -y
sudo make prefix=/usr/local install