Disclaimer: Most of the steps are copy-pastable. ;)
Git! Git! Git! The more I use it, the more I love it.
If you are reading this, I will assume that you know what Git is and for what it is used.
I will be telling very briefly, how I use the latest stable version of Git to make most out of it, for example, git-subtree.
I will be covering the installation for Ubuntu 12.04 but it should work on any linux distro. Like most the things, you can choose to install it via
apt-get but as you might be aware of, it will give you an oooooooold version.
To get the lastest and the best, let's build from source.
First quickly update the packages.
And now install the dependencies.
sudo apt-get install libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev build-essential
Download the version you want from Google code page. I will download
18.104.22.168as it is latest stable at the time of writing this article.
Now, extract the tarball you jusy downloaded. (I know remembering these nifty flags is always a pain, so Ctrl+C and Ctrl+V it.)
tar -zxf git-22.214.171.124.tar.gz
Go into the extracted folder.
Now install it.
make prefix=/usr/local all
sudo make prefix=/usr/local install
Done! If you ever need to update it in future, use the Git itself to do it.
git clone git://git.kernel.org/pub/scm/git/git.git
Setting It Up
Once I install it on a new machine, I set the global user details right away.
git config --global user.name "YourName"
git config --global user.email firstname.lastname@example.org