<?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; git</title>
	<atom:link href="http://honoluluhacker.com/tag/git/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>2</slash:comments>
		</item>
		<item>
		<title>git merge stategy for deploy.rb</title>
		<link>http://honoluluhacker.com/2008/12/19/git-merge-stategy-for-deployrb/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=git-merge-stategy-for-deployrb</link>
		<comments>http://honoluluhacker.com/2008/12/19/git-merge-stategy-for-deployrb/#comments</comments>
		<pubDate>Fri, 19 Dec 2008 18:02:54 +0000</pubDate>
		<dc:creator>kenglish</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://honoluluhacker.com/?p=450</guid>
		<description><![CDATA[My problem is that I have multiple git branch of a rails project and in each branch, I want to maintain a different value the branch setting my deploy.rb. For example: In branch v1.0.0-stable set :branch, "v1.0.0-stable" In branch, I want v1.0.1-stable set :branch, "v1.0.1-stable" In the master branch, I want no value. The problem [...]]]></description>
			<content:encoded><![CDATA[<p>My problem is that I have multiple git branch of a rails project and in each branch, I want to maintain a different value the branch setting my deploy.rb. For example:</p>
<p>In branch v1.0.0-stable</p>
<pre>set :branch, "v1.0.0-stable"</pre>
<p>In branch, I want v1.0.1-stable</p>
<pre>set :branch, "v1.0.1-stable"</pre>
<p>In the master branch, I want no value.</p>
<p>The problem is that I often merge from v1.0.1-stable into the master branch and this overwrites the deploy.rb. This can be frustrating because every time  I need to remember to remove that &#8220;set :branch&#8221; line from the deploy.rb. If I forget and deploy from the master, it  will deploy version &#8220;v1.0.1-stable&#8221; instead of master. This always results in my wondering  &#8220;Why didn&#8217;t the deploy work? Why aren&#8217;t my changes on the site?&#8221;</p>
<p>The only way that I could find to prevent this is to adding a line  my gitattributes file.</p>
<p>In .git/info/attributes, I added:</p>
<pre>deploy.rb merge="ours"</pre>
<p>Ours is a merge strategy and this tells git always apply</p>
<pre>      ours
           This resolves any number of heads, but the result of the merge is
           always the current branch head. It is meant to be used to
           supersede old development history of side branches.</pre>
<p><strong>Note: </strong><br />
If you Google git merge the first 5 pages of results are the man page for the git-merge command. Why does everyone feel the need to replicate the man page all over the internet. Seriously! If what I needed was in the man page, I wouldn&#8217;t be using Google!</p>
]]></content:encoded>
			<wfw:commentRss>http://honoluluhacker.com/2008/12/19/git-merge-stategy-for-deployrb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

