<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>themattharris.com &#187; git</title>
	<atom:link href="http://themattharris.com/tag/git/feed/" rel="self" type="application/rss+xml" />
	<link>http://themattharris.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Mon, 04 Jan 2010 17:35:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Setting up your Git installation to use a remote repository (git clone)</title>
		<link>http://www.themattharris.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fthemattharris.com%2F2008%2F08%2Fsetting-up-your-git-installation-to-use-a-remote-repository-git-clone%2F&amp;seed_title=Setting+up+your+Git+installation+to+use+a+remote+repository+%28git+clone%29</link>
		<comments>http://www.themattharris.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fthemattharris.com%2F2008%2F08%2Fsetting-up-your-git-installation-to-use-a-remote-repository-git-clone%2F&amp;seed_title=Setting+up+your+Git+installation+to+use+a+remote+repository+%28git+clone%29#comments</comments>
		<pubDate>Thu, 28 Aug 2008 01:40:41 +0000</pubDate>
		<dc:creator>themattharris</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[clone]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[unfuddle]]></category>

		<guid isPermaLink="false">http://www.themattharris.com/?p=88</guid>
		<description><![CDATA[This is part 3 of a 4 part series of setting up your systems to use Git.

So you&#8217;ve installed Git on your remote server and now want to be able to keep connect to a remote Git repository.  This post will go through setting up a connection to two popular repository hosting providers, Unfuddle [...]]]></description>
			<content:encoded><![CDATA[<p>This is part 3 of a 4 part series of setting up your systems to use Git.</p>

<p>So you&#8217;ve installed Git on your remote server and now want to be able to keep connect to a remote Git repository.  This post will go through setting up a connection to two popular repository hosting providers, <a href="http://www.unfuddle.com">Unfuddle</a> and <a href="http://www.github.com">Github</a>. I should stress these sites provide instructions on how to connect to their repositories and so what I talk about here is already on these sites; I just wanted to have a complete set of instructions available in one place.<span id="more-88"></span></p>

<h2>What you will need</h2>

<ul>
<li>SSH root access to your server (MediaTemple offer this though the <a href="http://ac.mediatemple.net">Account Center</a></li>
<li>An account on Unfuddle or Github</li>
<li>An SSH Keypair setup on your server (if you&#8217;ve not done this yet see <a href="/2008/08/06/generating-an-ssh-keypair/">Generating an SSH Keypair</a></li>
<li>About 15 minutes of time</li>
</ul>

<h2>Find out your SSH Key</h2>

<p>Remote repositories use SSH Tunnels to transmit data between client and host.  For this to work we need to register the SSH Key on our server with the remote repository. To find out what your SSH Key is you need to:</p>

<ol>
<li>Log into your server using SSH. Usually this is <code>ssh root@your-domain.com</code></li>
<li>Print the key to the terminal by entering the command : <code>cat ~/.ssh/id_rsa.pub</code></li>
<li>Copy everything that was just output to the screen to a blank document or your clipboard. It will be something like <code>ssh-rsa == root@</code></li>
</ol>

<h2>Registering our key with the remote repository</h2>

<p>Now we have our SSH key we need to register it with our account on the remote repository. For Github this is on your <a href="https://github.com/account">account page</a> under &#8220;SSH Public Keys&#8221;. On Unfuddle it&#8217;s on the &#8220;Personal Settings&#8221; page under &#8220;Public Keys&#8221;.</p>

<ol>
<li>On Github choose to &#8220;add another public key&#8221;, whilst on Unfuddle choose &#8220;New Public Key&#8230;&#8221;</li>
<li>You&#8217;ll be asked for a title and a value. Enter a name in the title box which will identify this key clearly, for example &#8220;root on example.com&#8221;. In the value box paste the key pair you copied from the terminal window earlier.</li>
</ol>

<p>These services now know who we are and we can authenticate with them. The next stage is to connect to the remote repositories.</p>

<h2>Connecting to the remote repositories</h2>

<ol>
<li>First thing you&#8217;ll want to do is find the Git Clone address. On Unfuddle this is displayed under the name of the repository on the Repositories page.  On Github the address is called the Public Clone URL and can be found on the Source page for the repository. It will look something like <code>git@something.unfuddle.com:something/project.git</code> or <code>git@github.com/username/project.git</code></li>
<li>SSH into your server if your not in it any longer.</li>
<li>Navigate into the folder which will contain your clone of the Git repository.</li>
<li>Git cannot be cloned as a folder which already exists. If you want to clone the repository to a folder called &#8220;apples&#8221; you need to make sure the folder &#8220;apples&#8221; doesn&#8217;t exist already. In this case i&#8217;m going to clone my git repository into the folder <code>httpdocs</code> by using the command <code>git clone  httpdocs</code></li>
<li>If this is the first time you&#8217;ve connect to the repository you&#8217;ll likely be asked to accept the RSA key fingerprint. Check the host name and IP that&#8217;s displayed and if your happy answer <code>yes</code></li>
<li>You&#8217;ll now be asked for the passphrase to your key. This is the phrase you entered when creating your SSH key pair before. This isn&#8217;t your SSH login password (unless you made them the same &#8211; which you really shouldn&#8217;t).</li>
<li>If you get errors here such as <strong>fatal: The remote end hung up unexpectedly</strong> make sure your password is correct and that you&#8217;ve registered your SSH key with your provider</li>
</ol>

<p>You&#8217;ve now got a clone of the remote repository on your server. Now check the permissions are correct for your requirements.  In my case I&#8217;ve cloned the repository into my web folder so I need to reset the permissions to those of my web account.</p>

<p>Now, whenever you want to update the copy of the code on your server just run <code>git pull</code></p>

<p>In part 4 of this 4 part series I&#8217;ll talk about how I use Git to keep my production servers and easily publish updates.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.themattharris.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fthemattharris.com%2F2008%2F08%2Fsetting-up-your-git-installation-to-use-a-remote-repository-git-clone%2F&amp;seed_title=Setting+up+your+Git+installation+to+use+a+remote+repository+%28git+clone%29/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Generating an SSH Keypair</title>
		<link>http://www.themattharris.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fthemattharris.com%2F2008%2F08%2Fgenerating-an-ssh-keypair%2F&amp;seed_title=Generating+an+SSH+Keypair</link>
		<comments>http://www.themattharris.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fthemattharris.com%2F2008%2F08%2Fgenerating-an-ssh-keypair%2F&amp;seed_title=Generating+an+SSH+Keypair#comments</comments>
		<pubDate>Wed, 06 Aug 2008 05:46:56 +0000</pubDate>
		<dc:creator>themattharris</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[keypair]]></category>
		<category><![CDATA[mediatemple]]></category>
		<category><![CDATA[mt]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.themattharris.com/?p=18</guid>
		<description><![CDATA[This is part 2 of a 4 part series of setting up your systems to use Git but in this case, is of general interest to those who may need to generate SSH Keypairs.

Git uses SSH key pairs to authenticate the machine you are accessing the repository from with the place you store that repository. [...]]]></description>
			<content:encoded><![CDATA[<p>This is part 2 of a 4 part series of setting up your systems to use Git but in this case, is of general interest to those who may need to generate SSH Keypairs.</p>

<p>Git uses SSH key pairs to authenticate the machine you are accessing the repository from with the place you store that repository.  If you followed the post about installing Git on your MediaTemple server then this is the next step in getting Git ready.  This post should also act as a quick reference if you are not yet familiar with, or just want reminding of, the method of creating SSH public keypairs.<span id="more-18"></span></p>

<h2>What you will need</h2>

<ul>
<li>SSH root access to your server (MediaTemple offer this though the <a href="http://ac.mediatemple.net">Account Center</a>)</li></li>
<li>About 5 minutes of time</li>
</ul>

<h2>Method</h2>

<p>This is a quick process and remarkably easy to do.</p>

<ol>
<li>Log into your server using SSH. Usually this is <code>ssh root@your-domain.com</code></li>
<li>Enter the command: <code>ssh-keygen -t rsa</code></li>
<li>You will be asked where you want to save the key file, just press enter. (If you are told the file already exists skip the next 2 steps)</li>
<li>You&#8217;ll now be asked to enter a passphrase . You should enter a passphrase you will remember here as you will need it when you communicate with the main repository from now on.</li>
<li>Confirm the passphrase.</li>
<li>You can view the public keypair that was just created by entering: <code>cat ~/.ssh/id_rsa.pub</code></li>
</ol>

<p>That&#8217;s all, in the next post i&#8217;ll show you how to connect to your repository on Unfuddle.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.themattharris.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fthemattharris.com%2F2008%2F08%2Fgenerating-an-ssh-keypair%2F&amp;seed_title=Generating+an+SSH+Keypair/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Installing Git binaries onto a MediaTemple server</title>
		<link>http://www.themattharris.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fthemattharris.com%2F2008%2F08%2Finstalling-git-binaries-onto-a-mediatemple-server%2F&amp;seed_title=Installing+Git+binaries+onto+a+MediaTemple+server</link>
		<comments>http://www.themattharris.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fthemattharris.com%2F2008%2F08%2Finstalling-git-binaries-onto-a-mediatemple-server%2F&amp;seed_title=Installing+Git+binaries+onto+a+MediaTemple+server#comments</comments>
		<pubDate>Wed, 06 Aug 2008 05:27:21 +0000</pubDate>
		<dc:creator>themattharris</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[mediatemple]]></category>
		<category><![CDATA[mt]]></category>

		<guid isPermaLink="false">http://www.themattharris.com/?p=29</guid>
		<description><![CDATA[This is part 1 of a series on setting up your systems to use Git.

As a developer I make frequent use of version control systems to keep my code safe and easily keep production sites up to date.  I previously used the widely supported SVN but have recently moved to the open source project [...]]]></description>
			<content:encoded><![CDATA[<p>This is part 1 of a series on setting up your systems to use Git.</p>

<p>As a developer I make frequent use of version control systems to keep my code safe and easily keep production sites up to date.  I previously used the widely supported <a href="http://subversion.tigris.org/">SVN</a> but have recently moved to the open source project <a href="http://git.or.cz/">Git</a>.  This move hasn&#8217;t been without it&#8217;s problems though and one of the largest was that Git wasn&#8217;t installed on my MediaTemple (<abbr title="MediaTemple">MT</abbr>) servers. Luckily, I found an MT knowledge base article titled <a href="http://kb.mediatemple.net/questions/820/Installing+Git+on+a+(dv)+3.5+server" title="MediaTemple knowledge base article">&#8220;Installing Git on a (dv) 3.5 server&#8221;</a> but soon found it had a couple of holes in it which prevented a successful install.</p>

<p>So, in case you find yourself in the same boat, I present my method for installing Git on a MediaTemple Dedicated Virtual 3.5 Server.<span id="more-29"></span></p>

<p>This method may work on other providers servers; if it does drop me a comment and i&#8217;ll update the post.  What I can tell you is this method is for CentOS 5 and will not work on a MediaTemple dv3 (it&#8217;s running Centos 4).</p>

<p>These steps are provided as a guide only and you follow them at your own risk.</p>

<h2>What you will need</h2>

<ol>
<li>SSH root access to your server (MediaTemple offer this though the <a href="http://ac.mediatemple.net">Account Center</a></li>
<li>Developer tools installed on your server (MediaTemple offer this though the <a href="http://ac.mediatemple.net">Account Center</a></li>
<li>An empty text document to save some links into</li>
<li>About 30 minutes of time (after backing up)</li>
</ol>

<h2>Method</h2>

<ol>
<li><strong>Ensure you have a backup of your server</strong></li>
<li>Using your favourite web browser navigate to <a href="http://mirror.centos.org/centos/5/os/i386/CentOS/">http://mirror.centos.org/centos/5/os/i386/CentOS/</a>, this address is case sensitive</li>
<li>You&#8217;ll see a whole list of packages which you can install. The ones you need to locate the current links for are:

<ul>
<li>python-iniparse <a href="http://mirror.centos.org/centos/5/os/i386/CentOS/python-iniparse-0.2.3-4.el5.noarch.rpm">http://mirror.centos.org/centos/5/os/i386/CentOS/python-iniparse-0.2.3-4.el5.noarch.rpm</a></li>
<li><abbr title="yellowdog updater modified">yum</abbr> <a href="http://mirror.centos.org/centos/5/os/i386/CentOS/yum-3.2.8-9.el5.centos.1.noarch.rpm">http://mirror.centos.org/centos/5/os/i386/CentOS/yum-3.2.8-9.el5.centos.1.noarch.rpm</a>
Copy the URLs into a text document as we will need them later.  The URLs given here were correct at the time of posting this article so may be wrong now as the version numbers change. To find the packages quickly search the page for the names i&#8217;ve given, e.g. python-iniparse</li>
</ul></li>
<li>Log into your server using SSH. 
<pre class="brush: plain;">ssh root@your-domain.com</pre></li>
<li>Install the python-iniparse package by entering the command: (replace with the URL you copied earlier): 
<pre class="brush: plain;">rpm -Uvh http://mirror.centos.org/centos/5/os/i386/CentOS/python-iniparse-0.2.3-4.el5.noarch.rpm</pre></li>
<li>Install yum by entering the command: (replace with the URL you copied earlier)
<pre class="brush: plain;">rpm -Uvh http://mirror.centos.org/centos/5/os/i386/CentOS/yum-3.2.8-9.el5.centos.1.noarch.rpm</pre></li>
<li>The last rpm we need is EPEL. Install this by entering: <pre class="brush: plain;">rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-2.noarch.rpm</pre></li>
<li>yum is now installed, making things a lot easier</li>
<li>Tell yum to update itself and everything it knows about by entering the command: 
<pre class="brush: plain;">yum -y update</pre></li>
<li>When yum has finished updating, we can install Git. Simply enter: 
<pre class="brush: plain;">yum install git</pre> and answer <code>y</code> to the prompts</li>
</ol>

<p>Git is now successfully installed on your MediaTemple server ready for use. Next post is about <a href="/2008/08/06/generating-an-ssh-keypair/">Generating an SSH keypair</a> which you need to access your remote repository.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.themattharris.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fthemattharris.com%2F2008%2F08%2Finstalling-git-binaries-onto-a-mediatemple-server%2F&amp;seed_title=Installing+Git+binaries+onto+a+MediaTemple+server/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
