<?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>Honolulu Hacker &#187; svn</title>
	<atom:link href="http://honoluluhacker.com/tag/svn/feed/" rel="self" type="application/rss+xml" />
	<link>http://honoluluhacker.com</link>
	<description>Tech, Linux, Rails by Honululu-based Kevin English</description>
	<lastBuildDate>Sat, 24 Sep 2011 22:53:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>svn2git for real men</title>
		<link>http://honoluluhacker.com/2009/05/21/svn2git-for-real-men/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=svn2git-for-real-men</link>
		<comments>http://honoluluhacker.com/2009/05/21/svn2git-for-real-men/#comments</comments>
		<pubDate>Thu, 21 May 2009 21:43:20 +0000</pubDate>
		<dc:creator>kenglish</dc:creator>
				<category><![CDATA[Mysql]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://honoluluhacker.com/?p=675</guid>
		<description><![CDATA[On the server, set up the remote repositories: 1 2 3 mkdir project1.git cd project1.git git --bare init Here&#8217;s a script to do them all in one shot, just modifiy the REPOS variable: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 #!/bin/sh &#160; REPOS=&#34;project1 project2 project3 project4&#34; &#160; for [...]]]></description>
			<content:encoded><![CDATA[<p>On the server, set up the remote repositories:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> project1.git
<span style="color: #7a0874; font-weight: bold;">cd</span> project1.git
<span style="color: #c20cb9; font-weight: bold;">git</span> <span style="color: #660033;">--bare</span> init</pre></td></tr></table></div>

<p>Here&#8217;s a script to do them all in one shot, just modifiy the REPOS variable:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #007800;">REPOS</span>=<span style="color: #ff0000;">&quot;project1 project2 project3 project4&quot;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">for</span> repo <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #007800;">$REPOS</span>
<span style="color: #000000; font-weight: bold;">do</span>
    <span style="color: #007800;">repo_dir</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$repo</span>.git&quot;</span>
    <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #007800;">$repo_dir</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Creating git directory  <span style="color: #007800;">$repo_dir</span>&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #007800;">$repo_dir</span>
    <span style="color: #c20cb9; font-weight: bold;">git</span> <span style="color: #660033;">--bare</span> init
    <span style="color: #7a0874; font-weight: bold;">cd</span> ..
<span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #7a0874; font-weight: bold;">exit</span></pre></td></tr></table></div>

<p>Now, on the workstation:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> git-core <span style="color: #c20cb9; font-weight: bold;">git-svn</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> nirvdrum-svn2git <span style="color: #660033;">--source</span> http:<span style="color: #000000; font-weight: bold;">//</span>gems.github.com</pre></td></tr></table></div>

<p>Create the authors.txt in the following format:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">dburger = David Burger <span style="color: #000000; font-weight: bold;">&lt;</span>email<span style="color: #000000; font-weight: bold;">@</span>email.com<span style="color: #000000; font-weight: bold;">&gt;</span>
jdoe = John Doe <span style="color: #000000; font-weight: bold;">&lt;</span>jdoe<span style="color: #000000; font-weight: bold;">@</span>doe.com<span style="color: #000000; font-weight: bold;">&gt;</span></pre></td></tr></table></div>

<p>For one project, do the following:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> project1
<span style="color: #7a0874; font-weight: bold;">cd</span> project1
svn2git  https:<span style="color: #000000; font-weight: bold;">//</span>svn.myserver.org<span style="color: #000000; font-weight: bold;">/</span>repos<span style="color: #000000; font-weight: bold;">/</span>ses <span style="color: #660033;">--authors</span> ..<span style="color: #000000; font-weight: bold;">/</span>authors.txt
<span style="color: #c20cb9; font-weight: bold;">git</span> remote add origin hailstorm.myserver.org:<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>kenglish<span style="color: #000000; font-weight: bold;">/</span>repotest<span style="color: #000000; font-weight: bold;">/</span>ses.git
<span style="color: #c20cb9; font-weight: bold;">git</span> push <span style="color: #660033;">--all</span></pre></td></tr></table></div>

<p>The script:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #007800;">REPOS</span>=<span style="color: #ff0000;">&quot;project1 project2 project3 project4&quot;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">for</span> repo <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #007800;">$REPOS</span>
<span style="color: #000000; font-weight: bold;">do</span>
    <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #007800;">$repo</span>
    <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #007800;">$repo</span>
&nbsp;
    <span style="color: #007800;">cmd</span>=<span style="color: #ff0000;">&quot;svn2git https://svn.myserver.org/repos/<span style="color: #007800;">$repo</span> --authors ../authors.txt&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$cmd</span>
    <span style="color: #000000; font-weight: bold;">`</span><span style="color: #007800;">$cmd</span><span style="color: #000000; font-weight: bold;">`</span>
    <span style="color: #007800;">cmd</span>=<span style="color: #ff0000;">&quot;git remote add origin hailstorm.myserver.org:/home/kenglish/repotest/<span style="color: #007800;">$repo</span>.git&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$cmd</span>
    <span style="color: #000000; font-weight: bold;">`</span><span style="color: #007800;">$cmd</span><span style="color: #000000; font-weight: bold;">`</span>
    <span style="color: #007800;">cmd</span>=<span style="color: #ff0000;">&quot;git push --all&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$cmd</span>
    <span style="color: #000000; font-weight: bold;">`</span><span style="color: #007800;">$cmd</span><span style="color: #000000; font-weight: bold;">`</span>
    <span style="color: #7a0874; font-weight: bold;">cd</span> ..
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;DONE EXPORTING <span style="color: #007800;">$repo</span>&quot;</span> 
<span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #7a0874; font-weight: bold;">exit</span></pre></td></tr></table></div>

<p>Don&#8217;t diss the shell script, I leave in the echoes in case i need to test stuff out&#8230;</p>
<p>Note: Another option for the authors file is place it in your home directory .svn2git/authors (e.g. /home/kenglish/.svn2git/authors). Svn2git will automatically detect it and use it.<br />
Any questions? Comments?</p>
]]></content:encoded>
			<wfw:commentRss>http://honoluluhacker.com/2009/05/21/svn2git-for-real-men/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

