UNPKG

epubjs

Version:

Render ePub documents in the browser, across many devices

85 lines (55 loc) 4.54 kB
<?xml version='1.0' encoding='utf-8'?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Pro Git - professional version control</title> <meta content="http://www.w3.org/1999/xhtml; charset=utf-8" http-equiv="Content-Type"/> <link href="stylesheet.css" type="text/css" rel="stylesheet"/> <style type="text/css"> @page { margin-bottom: 5.000000pt; margin-top: 5.000000pt; }</style> </head> <body class="calibre"> <h2 class="calibre4" id="calibre_pb_5">Installing Git</h2> <p class="calibre3">Let's get into using some Git. First things first-you have to install it. You can get it a number of ways; the two major ones are to install it from source or to install an existing package for your platform.</p> <h3 class="calibre5">Installing from Source</h3> <p class="calibre3">If you can, it's generally useful to install Git from source, because you'll get the most recent version. Each version of Git tends to include useful UI enhancements, so getting the latest version is often the best route if you feel comfortable compiling software from source. It is also the case that many Linux distributions contain very old packages; so unless you're on a very up-to-date distro or are using backports, installing from source may be the best bet.</p> <p class="calibre3">To install Git, you need to have the following libraries that Git depends on: curl, zlib, openssl, expat, and libiconv. For example, if you're on a system that has yum (such as Fedora) or apt-get (such as a Debian based system), you can use one of these commands to install all of the dependencies:</p> <pre class="calibre9"><code class="calibre10">$ yum install curl-devel expat-devel gettext-devel \ openssl-devel zlib-devel $ apt-get install libcurl4-gnutls-dev libexpat1-dev gettext \ libz-dev </code></pre> <p class="calibre3">When you have all the necessary dependencies, you can go ahead and grab the latest snapshot from the Git web site:</p> <pre class="calibre9"><code class="calibre10">http://git-scm.com/download </code></pre> <p class="calibre3">Then, compile and install:</p> <pre class="calibre9"><code class="calibre10">$ tar -zxf git-1.6.0.5.tar.gz $ cd git-1.6.0.5 $ make prefix=/usr/local all $ sudo make prefix=/usr/local install </code></pre> <p class="calibre3">After this is done, you can also get Git via Git itself for updates:</p> <pre class="calibre9"><code class="calibre10">$ git clone git://git.kernel.org/pub/scm/git/git.git </code></pre> <h3 class="calibre5">Installing on Linux</h3> <p class="calibre3">If you want to install Git on Linux via a binary installer, you can generally do so through the basic package-management tool that comes with your distribution. If you're on Fedora, you can use yum:</p> <pre class="calibre9"><code class="calibre10">$ yum install git-core </code></pre> <p class="calibre3">Or if you're on a Debian-based distribution like Ubuntu, try apt-get:</p> <pre class="calibre9"><code class="calibre10">$ apt-get install git-core </code></pre> <h3 class="calibre5">Installing on Mac</h3> <p class="calibre3">There are two easy ways to install Git on a Mac. The easiest is to use the graphical Git installer, which you can download from the Google Code page (see Figure 1-7):</p> <pre class="calibre9"><code class="calibre10">http://code.google.com/p/git-osx-installer </code></pre> <p class="calibre3"><img src="18333fig0107-tn.png" alt="Figure 1-7. Git OS X installer." title="Figure 1-7. Git OS X installer." class="calibre6"/></p> <p class="calibre3">The other major way is to install Git via MacPorts (<code class="calibre10">http://www.macports.org</code>). If you have MacPorts installed, install Git via</p> <pre class="calibre9"><code class="calibre10">$ sudo port install git-core +svn +doc +bash_completion +gitweb </code></pre> <p class="calibre3">You don't have to add all the extras, but you'll probably want to include +svn in case you ever have to use Git with Subversion repositories (see Chapter 8).</p> <h3 class="calibre5">Installing on Windows</h3> <p class="calibre3">Installing Git on Windows is very easy. The msysGit project has one of the easier installation procedures. Simply download the installer exe file from the Google Code page, and run it:</p> <pre class="calibre9"><code class="calibre10">http://code.google.com/p/msysgit </code></pre> <p class="calibre3">After it's installed, you have both a command-line version (including an SSH client that will come in handy later) and the standard GUI.</p> </body> </html>