<?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>Rails on the Run &#187; git</title>
	<atom:link href="http://railsontherun.com/tag/git/feed/" rel="self" type="application/rss+xml" />
	<link>http://railsontherun.com</link>
	<description>Rails experiments by Matt Aimonetti</description>
	<lastBuildDate>Tue, 23 Feb 2010 07:28:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Freezing Rails with Git</title>
		<link>http://railsontherun.com/2008/04/16/freezing-rails-with-git/</link>
		<comments>http://railsontherun.com/2008/04/16/freezing-rails-with-git/#comments</comments>
		<pubDate>Wed, 16 Apr 2008 08:21:00 +0000</pubDate>
		<dc:creator>Matt Aimonetti</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[freeze]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[rais]]></category>

		<guid isPermaLink="false">http://railsontherun.com/2008/06/18/freezing-rails-with-git</guid>
		<description><![CDATA[As you&#8217;ve probably heard, Rails now moved to its own GitHub repo. If, like me you were a heavy piston user, you are wondering how you will be able to do the same thing if you switch to git. First off, you need to know that Piston will soon support git. As a matter a [...]]]></description>
			<content:encoded><![CDATA[<p>As you&#8217;ve <a href="http://blog.rubyonrails.com/2008/4/11/rails-premieres-on-github">probably heard</a>, Rails now moved to <a href="http://github.com/rails/rails">its own GitHub repo</a>.</p>
<p>If, like me you were a heavy <a href="http://piston.rubyforge.org/">piston</a> user, you are wondering how you will be able to do the same thing if you switch to git. </p>
<p>First off, you need to know that Piston will soon support git. As a matter a fact it already does. At least you can download a beta version from <a href="http://blog.teksol.info/tags/piston">François&#8217;s blog</a>.</p>
<p>You can also go with <a href="http://evil.che.lu/projects/braid">giston/braids</a> which was meant to make the svn/switch easy on you. I heard rumors that <a href="http://evil.che.lu">evilchelu</a> might not keep on developing this project. You might want to check with him.</p>
<p>Personally I didn&#8217;t really like using any of these solutions. Rails also came with its&#8217; own approach. (<a href="http://github.com/rails/rails/commit/4b17082107aced980fc4b511028ee763247bc5ab">rake rails:freeze:edge</a>)</p>
<p>When I recently worked on <a href="http://railsontherun.com/2008/4/15/merb-tip-how-to-freeze-a-project">Merb&#8217;s freezer</a>, I discovered the power of <a href="http://www.kernel.org/pub/software/scm/git/docs/git-submodule.html">git submodules</a>.</p>
<p>Submodules allow you to import &#8220;modules&#8221; from other git repos inside your own repo. Basically they do what piston does for SVN, apart that submodules are built-in git. Of course it has an expected limitation, you can only add git submodules. </p>
<p>The good news is that Rails moved to git and now you can &#8220;freeze&#8221; Rails as a submodule and update really easily!</p>
<p>First thing first, you need to move your project to git. If you are not confident it&#8217;s a good move yet, you can use &#8220;git-svn&#8221;. However, I would personally recommend you don&#8217;t. I did that for few months and when I finally moved to git only, it was a pain to restructure the entire path of the app.</p>
<p>Anyways, let&#8217;s say you created a new <a href="http://github.com">github</a> project and if still wish to use git svn do:</p>
<table class="CodeRay">
<tr>
<td class="line_numbers" title="click to toggle" onclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }">
<pre>1<tt>
</tt>2<tt>
</tt>3<tt>
</tt>4<tt>
</tt></pre>
</td>
<td class="code">
<pre ondblclick="with (this.style) { overflow = (overflow == 'auto' || overflow == '') ? 'visible' : 'auto' }"><span class="er">$</span> git-svn import svn<span class="sy">:/</span>/path-to-your-svn-repo project-name<tt>
</tt><span class="er">$</span> cd project-name<tt>
</tt><span class="er">$</span> git remote add origin git<span class="iv">@github</span>.com<span class="sy">:mattetti</span>/project-name.git<tt>
</tt><span class="er">$</span> git push origin master<tt>
</tt></pre>
</td>
</tr>
</table>
<p>Your project is now under git, but if you pistonized Rails, you can&#8217;t update it anymore <img src='http://railsontherun.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>Do not fear my dear friend and do as follows:</p>
<table class="CodeRay">
<tr>
<td class="line_numbers" title="click to toggle" onclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }">
<pre>1<tt>
</tt>2<tt>
</tt>3<tt>
</tt>4<tt>
</tt><strong>5</strong><tt>
</tt>6<tt>
</tt></pre>
</td>
<td class="code">
<pre ondblclick="with (this.style) { overflow = (overflow == 'auto' || overflow == '') ? 'visible' : 'auto' }"><span class="er">$</span> rm -rf vendor/rails<tt>
</tt><span class="er">$</span> git commit<tt>
</tt><span class="er">$</span> git submodule add git<span class="sy">:/</span>/github.com/rails/rails.git vendor/rails<tt>
</tt><span class="er">$</span> git submodule init<tt>
</tt><span class="er">$</span> git commit<tt>
</tt><span class="er">$</span> </pre>
</td>
</tr>
</table>
<p>That&#8217;s it you are done <img src='http://railsontherun.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Next time you want to update just do:</p>
<table class="CodeRay">
<tr>
<td class="line_numbers" title="click to toggle" onclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }">
<pre>1<tt>
</tt>2<tt>
</tt>3<tt>
</tt></pre>
</td>
<td class="code">
<pre ondblclick="with (this.style) { overflow = (overflow == 'auto' || overflow == '') ? 'visible' : 'auto' }"><span class="er">$</span> cd vendor/rails<tt>
</tt><span class="er">$</span> git remote update<tt>
</tt><span class="er">$</span> git merge origin/master</pre>
</td>
</tr>
</table>
<p>or you can also do</p>
<table class="CodeRay">
<tr>
<td class="line_numbers" title="click to toggle" onclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }">
<pre>1<tt>
</tt>2<tt>
</tt></pre>
</td>
<td class="code">
<pre ondblclick="with (this.style) { overflow = (overflow == 'auto' || overflow == '') ? 'visible' : 'auto' }"><span class="er">$</span> cd vendor/rails<tt>
</tt><span class="er">$</span> git pull</pre>
</td>
</tr>
</table>
<p>(yes, each plugin acts a a normal git repo)</p>
<p>A quick note for gitHub users. If you browse your repo you won&#8217;t see the vendor/rails folder and might freak out. Don&#8217;t! Git is smart and wants to stay slim, instead of copying the files over, it just creates a reference to the original repo. If you try to pull your project in another folder you will see that the Rails folder gets created as expected.</p>
<p>Personally, when plugins are not available in a git repo I usually do a simple svn export to my project vendor&#8217;s folder. If I need to modify one of these plugins, I just import it to <a href="http://github.com">github</a> and work on it from there.</p>
<p>You might still want to stick to Piston or Braids and that&#8217;s fine, but now you won&#8217;t have an excuse not to switch to Git <img src='http://railsontherun.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>UPDATE: I just found out that Graeme wrote a <a href="http://woss.name/2008/04/09/using-git-submodules-to-track-vendorrails/">nice detailed post</a> about tracking plugins using git, <a href="http://woss.name/2008/04/09/using-git-submodules-to-track-vendorrails/">check it out</a></p>
]]></content:encoded>
			<wfw:commentRss>http://railsontherun.com/2008/04/16/freezing-rails-with-git/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>starting the migration to GitHub</title>
		<link>http://railsontherun.com/2008/03/05/starting-the-migration-to-github/</link>
		<comments>http://railsontherun.com/2008/03/05/starting-the-migration-to-github/#comments</comments>
		<pubDate>Wed, 05 Mar 2008 07:48:00 +0000</pubDate>
		<dc:creator>Matt Aimonetti</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[projects]]></category>

		<guid isPermaLink="false">http://railsontherun.com/2008/03/05/starting-the-migration-to-github</guid>
		<description><![CDATA[I started moving some of my projects to GitHub. Here is my GitHub account. Projects moved to GitHub: GlobaLite ActiveRecord Backup mimetype-fu I&#8217;m planning on moving GoogleCharts, RandomWordGenerator and some not released stuff to GitHub so people can have fun forking my projects. Git and GitHub are the new cool things. GitHub is planning on [...]]]></description>
			<content:encoded><![CDATA[<p>I started moving some of my projects to <a href="http://github.com">GitHub</a>.</p>
<p><a href="http://github.com/matta">Here</a> is my <a href="http://github.com">GitHub</a> account.</p>
<p>Projects moved to <a href="http://github.com">GitHub</a>:</p>
<ul>
<li>
<p><a href="http://github.com/matta/globalite/tree">GlobaLite</a></p>
</li>
<li>
<p><a href="http://github.com/matta/ar-backup/tree">ActiveRecord Backup</a></p>
</li>
<li>
<p><a href="http://github.com/matta/mimetype-fu/tree">mimetype-fu</a></p>
</li>
</ul>
<p>I&#8217;m planning on moving <a href="http://rubyforge.org/projects/googlecharts/">GoogleCharts</a>, <a href="http://rubyforge.org/projects/random-word-gen/">RandomWordGenerator</a> and some not released stuff to GitHub so people can have fun forking my projects.</p>
<p><a href="http://git.or.cz/">Git</a> and <a href="http://github.com">GitHub</a> are the new cool things. GitHub is planning on setting up a gem server while they are already offering tarball download and a post-receive hook. (they also plan on becoming myspace for geeks, but that&#8217;s another story)</p>
<p>Do you have to switch to git and github? Honestly, &#8230;no you don&#8217;t..<br />
Git can act as SVN, but let&#8217;s be honest, if you switch to a new SCM it needs to do more. I&#8217;ve been using Git for a couple of months and even though I still don&#8217;t have a full understanding of this SCM, I really enjoy using it.</p>
<p>So, get over it, learn on your own or purchase <a href="https://peepcode.com/products/git">this excellent peepcode</a></p>
<p>Email me to get a GitHub invite (Tom and Chris gave me some invites for readers) or/and try <a href="http://gitorious.org/">Gitorious</a>.</p>
<p>The fact that some major players (<a href="http://topfunky.com/">Topfunky</a>, <a href="http://weblog.techno-weenie.net/2008/3/4/my-gushing-github-love-letter">technoweenie</a>, <a href="http://errtheblog.com/">Chris &amp; PJ</a>, <a href="http://railstips.org/2008/2/16/git-and-github/">jnunemaker</a> and major projects such as <a href="http://weblog.rubyonrails.com/2008/2/28/capistrano-2-2-0">capistrano</a>, <a href="http://rubyhitsquad.com/Vlad_the_Deployer.html">vlad the deployer</a> and <a href="http://merbivore.com">Merb</a> use and support Git is a sign that it&#8217;s the next big thing. </p>
<p>Also, I believe that a lot of developers will also be motivated to move their plugins/gems to GitHub because they simply can&#8217;t always maintain their own libs and/or just hope people will fork their project and contribute back.</p>
]]></content:encoded>
			<wfw:commentRss>http://railsontherun.com/2008/03/05/starting-the-migration-to-github/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use github and submit a patch</title>
		<link>http://railsontherun.com/2008/03/03/how-to-use-github-and-submit-a-patch/</link>
		<comments>http://railsontherun.com/2008/03/03/how-to-use-github-and-submit-a-patch/#comments</comments>
		<pubDate>Mon, 03 Mar 2008 08:22:00 +0000</pubDate>
		<dc:creator>Matt Aimonetti</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[contribute]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[merb]]></category>

		<guid isPermaLink="false">http://railsontherun.com/2008/06/18/how-to-use-github-and-submit-a-patch</guid>
		<description><![CDATA[If you don&#8217;t know about git and github yet, it&#8217;s time you clean up your RSS feeds and find some good source of information. Github is used by the Merb core team and I&#8217;ll show you how to use github to fork Merb, make your modifications and &#8220;submit your patch&#8221;. This is the exact reason [...]]]></description>
			<content:encoded><![CDATA[<p>If you don&#8217;t know about <a href="http://git.or.cz/">git</a> and <a href="http://github.com">github</a> yet, it&#8217;s time you clean up your RSS feeds and find some good source of information.</p>
<p><a href="http://github.com">Github</a> is used by the <a href="http://merbivore.com">Merb core team</a> and I&#8217;ll show you how to use github to fork Merb, make your modifications and &#8220;submit your patch&#8221;.</p>
<p>This is the exact reason why github is simply awesome, it makes forking projects just super simple and submitting changes even easier.</p>
<p>First thing, you need to have a github account, if you don&#8217;t have one yet, email me, I have a couple of invitations left, otherwise, just wait until github gets public.</p>
<p>Now, let&#8217;s go to <a href="http://github.com/wycats/merb-core/tree/master">Merb&#8217;s repository</a> and fork Merb-core by clicking on the fork button.</p>
<p><img src="http://img.skitch.com/20080303-q2aceaadcqk59kqck4b199bdmh.jpg" alt="fork merb"/></p>
<p>Actually, for this example, I&#8217;ll fork <a href="http://github.com/wycats/merb-plugins/tree/master">merb-plugins</a> because I want to improve the ActiveRecord rake tasks.</p>
<p>Because I forked merb-plugins, I now have my own forked repo: !<img src="http://img.skitch.com/20080303-g8jas46gq1enn9fhu1t7rsyunj.jpg" alt="my forked repo"/></p>
<p>I&#8217;ll start by checking out/cloning my forked repo locally.</p>
<table class="CodeRay">
<tr>
<td class="line_numbers" title="click to toggle" onclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }">
<pre><tt>
</tt></pre>
</td>
<td class="code">
<pre ondblclick="with (this.style) { overflow = (overflow == 'auto' || overflow == '') ? 'visible' : 'auto' }">git clone git<span class="iv">@github</span>.com<span class="sy">:mattetti</span>/merb-plugins.git</pre>
</td>
</tr>
</table>
<p>!<img src="http://img.skitch.com/20080303-rf87t44c3c6m6hqy5b38ksycua.jpg" alt="git clone"/></p>
<p>Great I can now make my own changes&#8230;. but wait, what if the merb core team makes a change to the code? Well, I need to track their changes. Here is how:</p>
<table class="CodeRay">
<tr>
<td class="line_numbers" title="click to toggle" onclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }">
<pre><tt>
</tt></pre>
</td>
<td class="code">
<pre ondblclick="with (this.style) { overflow = (overflow == 'auto' || overflow == '') ? 'visible' : 'auto' }">git remote add coreteam git<span class="sy">:/</span>/github.com/wycats/merb-plugins.git</pre>
</td>
</tr>
</table>
<p>FYI, it adds the following to edit .git/config:</p>
<table class="CodeRay">
<tr>
<td class="line_numbers" title="click to toggle" onclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }">
<pre>1<tt>
</tt>2<tt>
</tt>3<tt>
</tt>4<tt>
</tt></pre>
</td>
<td class="code">
<pre ondblclick="with (this.style) { overflow = (overflow == 'auto' || overflow == '') ? 'visible' : 'auto' }"><tt>
</tt>  [remote <span class="s"><span class="dl">&quot;</span><span class="k">coreteam</span><span class="dl">&quot;</span></span>]<tt>
</tt>  url = git<span class="sy">:/</span>/github.com/wycats/merb-plugins.git<tt>
</tt>  fetch = +refs/heads/*<span class="sy">:refs</span>/remotes/coreteam/*<tt>
</tt></pre>
</td>
</tr>
</table>
<p>then </p>
<table class="CodeRay">
<tr>
<td class="line_numbers" title="click to toggle" onclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }">
<pre><tt>
</tt></pre>
</td>
<td class="code">
<pre ondblclick="with (this.style) { overflow = (overflow == 'auto' || overflow == '') ? 'visible' : 'auto' }">git fetch coreteam</pre>
</td>
</tr>
</table>
<p>and finally</p>
<table class="CodeRay">
<tr>
<td class="line_numbers" title="click to toggle" onclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }">
<pre><tt>
</tt></pre>
</td>
<td class="code">
<pre ondblclick="with (this.style) { overflow = (overflow == 'auto' || overflow == '') ? 'visible' : 'auto' }">git checkout -b coreteam coreteam/master</pre>
</td>
</tr>
</table>
<p>You can now track the latest change and merge them with your branch. Note that you can also track other forks and merge some other changes. (just that feature is worth using git)</p>
<p>Alright, now you can do your stuff, and push your local change to your remote repo at github.</p>
<p>Once you are done, you can simply click on the &#8220;pull request button&#8221;</p>
<p><img src="http://img.skitch.com/20080303-xxh5d3a2uu65ksf8u4i9tga59e.jpg" alt="pull request button"/></p>
<p>fill up the form and select the recipient. (wycats in this example if you want him to merge your changes into the official version of Merb).</p>
<p><img src="http://img.skitch.com/20080303-dei7bxpt577gqe3d1x4ncpmq6w.jpg" alt="pull request"/></p>
<p>p.s: The github guys are working on a gem to make our loves easier, give <a href="http://github.com/defunkt/github-gem/tree/master">http://github.com/defunkt/github-gem/tree/master</a> a try. I&#8217;ll post about the gem when it will be a bit more stable.</p>
]]></content:encoded>
			<wfw:commentRss>http://railsontherun.com/2008/03/03/how-to-use-github-and-submit-a-patch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>resolving git-svn conflicts</title>
		<link>http://railsontherun.com/2008/02/29/resolving-git-svn-conflicts/</link>
		<comments>http://railsontherun.com/2008/02/29/resolving-git-svn-conflicts/#comments</comments>
		<pubDate>Fri, 29 Feb 2008 22:40:00 +0000</pubDate>
		<dc:creator>Matt Aimonetti</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[git-svn]]></category>
		<category><![CDATA[repository]]></category>
		<category><![CDATA[scm]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://railsontherun.com/2008/02/29/resolving-git-svn-conflicts</guid>
		<description><![CDATA[I&#8217;ve been using git and git-svn for a little while and never had a problem&#8230; until today. On one of my project, we have a SVN repo but since I prefer using Git, I&#8217;m using git-svn. Git-svn has been great, it let me create my own local branches for each new set of features (that&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using <a href="http://git.or.cz/">git</a> and <a href="http://www.kernel.org/pub/software/scm/git/docs/git-svn.html">git-svn</a> for a little while and never had a problem&#8230; until today.</p>
<p>On one of my <a href="http://gumgum.com">project</a>, we have a SVN repo but since I prefer using Git, I&#8217;m using git-svn.</p>
<p>Git-svn has been great, it let me create my own local branches for each new set of features (that&#8217;s when I don&#8217;t forget to create a branch) and to commit all the changes back to svn.</p>
<p>The problem today happened after I did a simple git-svn rebase. I had some sort of error and my local repo looked like it got reverted to the head of the svn repo&#8230;. </p>
<pre><code>error: patch failed: trunk/app/models/view.rb:1
error: trunk/app/models/view.rb: patch does not apply
[blah blah]
sing index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
</code></pre>
<p>I hadn&#8217;t committed to SVN for 24 hours and had a lot of work that was just checked in locally&#8230; You can imagine the panic.  <a href="http://notch8.com">Rob</a> started digging in the .git repo to finally find the hash representing the latest delta before the rebase. With the help of the #caboose guys, I did a simple</p>
<pre><code>git reset --hard hash-name
</code></pre>
<p>Which restore my repo to the pre SVN commit state. Awesome&#8230; however I still had issues to commit my stuff. After a little while I as able to commit again, worked a bit more and tried to commit again&#8230;. same error <img src='http://railsontherun.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>But this time I noticed I could simply do</p>
<pre><code>git rebase --abort
</code></pre>
<p>to restore the original branch.an </p>
<p>But I still couldn&#8217;t commit properly&#8230; until I discovered that I just needed to fix the conflicts manually using</p>
<pre><code>git-mergetool
</code></pre>
<p>git-mergetool uses whichever merge tool available: kdiff3 tkdiff xxdiff meld gvimdiff opendiff emerge vimdiff filemerge</p>
<p>I fixed my conflicts in no time, then did a </p>
<pre><code>git rebase --continue
</code></pre>
<p>and finally</p>
<pre><code>git-svn dcommit
</code></pre>
<p>Looking back, I wish I knew how to properly deal with conflicts when using git-svn, I wasted a bit of my precious time <img src='http://railsontherun.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />   hopefully this post will help you.</p>
<p>p.s:  <a href="http://brian.maybeyoureinsane.net/blog/2008/01/31/git-sake-tasks/">here</a> is an interesting use of Sake to handle git-svn</p>
]]></content:encoded>
			<wfw:commentRss>http://railsontherun.com/2008/02/29/resolving-git-svn-conflicts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

