<?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>Ash Searle's Blog &#187; Git</title>
	<atom:link href="http://hexmen.com/blog/category/git/feed/" rel="self" type="application/rss+xml" />
	<link>http://hexmen.com/blog</link>
	<description>On programming, and other things...</description>
	<lastBuildDate>Thu, 03 Dec 2009 10:29:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Getting git to work on OS X&#160;Tiger</title>
		<link>http://hexmen.com/blog/2008/08/getting-git-to-work-on-os-x-tiger/</link>
		<comments>http://hexmen.com/blog/2008/08/getting-git-to-work-on-os-x-tiger/#comments</comments>
		<pubDate>Fri, 22 Aug 2008 11:58:10 +0000</pubDate>
		<dc:creator>Ash</dc:creator>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[Tip]]></category>

		<guid isPermaLink="false">http://hexmen.com/blog/?p=58</guid>
		<description><![CDATA[If you haven&#8217;t heard of git yet, it&#8217;s quickly becoming the preferred version-control system for tons of open-source projects, including the twin suns of ruby on rails and prototype. In fact, if you keep your eye on the github blog you&#8217;ll see a steady stream of well-known projects moving over to git, as diverse as [...]]]></description>
			<content:encoded><![CDATA[<p>If you haven&#8217;t heard of <a href="http://en.wikipedia.org/wiki/Git_(software)">git</a> yet, it&#8217;s quickly becoming the preferred version-control system for tons of open-source projects, including the twin suns of <a href="http://github.com/rails/rails/tree/master">ruby on rails</a> and <a href="http://github.com/sstephenson/prototype/tree/master">prototype</a>.</p>
<p>In fact, if you keep your eye on the <a href="http://github.com/blog">github blog</a> you&#8217;ll see a steady stream of well-known projects moving over to git, as diverse as the <a href="http://github.com/joshuaclayton/blueprint-css/tree/master">Blueprint CSS framework</a> and the <a href="http://github.com/ghc-hq/ghc/tree/master">Haskell compiler</a>.</p>
<p>Basically, if <em>git</em> was a stock-market commodity, analysts would be issuing <strong>strong buy</strong> recommendations left, right and centre.  Git&#8217;s <a href="http://en.wikipedia.org/wiki/The_Tipping_Point">tipping-point</a> has arrived.</p>
<h3>How to play</h3>
<p><em>If you&#8217;ve arrived here via search-engine, it&#8217;s probably because you&#8217;re trying to work around errors like <strong>Can&#8217;t locate Error.pm</strong> or <strong>Can&#8217;t locate SVN/Core.pm</strong>.  Read on&#8230;</em></p>
<p>I already had macports installed, but if you haven&#8217;t, follow the <a href="http://www.macports.org/install.php">macports install instructions</a> &#8211; we&#8217;ll be using macports to download and install git as it&#8217;s supposed to be simpler than building from source.</p>
<p>If you&#8217;ve had macports installed a while, make sure it&#8217;s up to date:</p>
<pre><code>
$ sudo port selfupdate
</code></pre>
<p>We want to use git to connect to subversion repositories as well, so we&#8217;ll just check that&#8217;s possible:</p>
<pre><code>
$ port list variant:svn
git-core        @1.6.0  devel/git-core
subversion      @1.5.1  devel/subversion
</code></pre>
<p>I already had subversion installed but through trial-and-error found I needed to reinstall it with perl-bindings (git must be using perl scripts to talk to subversion&#8230;)  Note: I&#8217;m using the <code>-f</code> flag to force it to reinstall, you might want to try without first, just to see what conflicts it brings up:</p>
<pre><code>
$ sudo port uninstall -f subversion-perlbindings
$ sudo port install -f subversion-perlbindings
</code></pre>
<p>Next, we install git:</p>
<pre><code>
# This may take a while to install with all its dependencies:
$ sudo port install git-core +svn
</code></pre>
<p>And finally, we check it works:</p>
<pre><code>
$ mkdir myproject; cd myproject;

# Check your PATH's set properly, this should output:
# fatal: Not a git repository
$ git svn

# If that's OK... clone a repository:
$ git svn clone <em>http://example.com/svn/project/trunk</em>
</code></pre>
<h3>Can&#8217;t locate Error.pm</h3>
<p>If you&#8217;re getting <em>Can&#8217;t locate Error.pm</em> or <em>Can&#8217;t locate SVN/Core.pm</em> you should immediately try:</p>
<pre><code>
$ PATH=/opt/local/bin:$PATH git svn</code></pre>
<p>If that works, you know it&#8217;s just a PATH problem.  It&#8217;s something to do with Apple&#8217;s perl install having slightly kooky ideas about where to store perl libraries.</p>
<p>If you&#8217;re still getting complaints about Error.pm, you need to install the CPAN module &#8211; and we&#8217;re going to use the /opt/local/bin instance of cpan, to make sure things go in the right place for us:</p>
<pre><code>
$ sudo /opt/local/bin/cpan -i lib::Error
</code></pre>
<p>Cross your fingers, and try again:</p>
<pre><code>
$ PATH=/opt/local/bin:$PATH
$ git svn clone <em>http://example.com/svn/project/trunk</em>
</code></pre>
<p>If things are working, git will spend a while cloning the subversion repository by pulling out every single revision so you can have a complete set of revisions (including deltas), ready for you to refer to with lightning-speed regardless of internet connectivity.  Which is nice.</p>
]]></content:encoded>
			<wfw:commentRss>http://hexmen.com/blog/2008/08/getting-git-to-work-on-os-x-tiger/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
