<?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>Pass By Value &#187; git</title>
	<atom:link href="http://passbyvalue.com/tag/git/feed/" rel="self" type="application/rss+xml" />
	<link>http://passbyvalue.com</link>
	<description>... or is it pass by reference?</description>
	<lastBuildDate>Thu, 26 Jan 2012 03:09:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Getting started with Heroku and Rails 3.1</title>
		<link>http://passbyvalue.com/2011/11/getting-started-with-heroku-and-rails-3-1/</link>
		<comments>http://passbyvalue.com/2011/11/getting-started-with-heroku-and-rails-3-1/#comments</comments>
		<pubDate>Wed, 16 Nov 2011 10:31:42 +0000</pubDate>
		<dc:creator>Trent</dc:creator>
				<category><![CDATA[Cloud]]></category>
		<category><![CDATA[IT Strategy]]></category>
		<category><![CDATA[Software development]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[heroku]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://passbyvalue.com/?p=221</guid>
		<description><![CDATA[Pre-requesites: RVM on your local machine with Ruby 1.9.2 Heroku account Switch to the 1.9.2 version of Ruby, install the rails and heroku gems, create your rails 3.1 application Terminal $ rvm 1.9.2 $ gem install rails $ gem install heroku $ rails new tickets $ cd tickets Add in the nifty-generators gem: /Gemfile gem &#34;nifty-generators&#34;, [...]]]></description>
			<content:encoded><![CDATA[<p>Pre-requesites:</p>
<ul>
<li><a href="http://beginrescueend.com/">RVM</a> on your local machine with Ruby 1.9.2</li>
<li><a href="http://www.heroku.com/">Heroku</a> account</li>
</ul>
<p>Switch to the 1.9.2 version of Ruby, install the rails and heroku gems, create your rails 3.1 application</p>
<div class="codeheader">Terminal</div>
<div class="codecolorer-container bash railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ rvm 1.9.2<br />
$ gem <span style="color: #c20cb9; font-weight: bold;">install</span> rails<br />
$ gem <span style="color: #c20cb9; font-weight: bold;">install</span> heroku<br />
$ rails new tickets<br />
$ <span style="color: #7a0874; font-weight: bold;">cd</span> tickets</div></div>
<p>Add in the <a href="https://github.com/ryanb/nifty-generators">nifty-generators</a> gem:</p>
<div class="codeheader">/Gemfile</div>
<div class="codecolorer-container ruby railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">gem <span style="color:#996600;">&quot;nifty-generators&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:group</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:development</span></div></div>
<div class="codeheader">Terminal</div>
<div class="codecolorer-container bash railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666;">$ </span>bundle <span style="color: #c20cb9; font-weight: bold;">install</span></div></div>
<p>Generate the layout</p>
<div class="codeheader">Terminal</div>
<div class="codecolorer-container bash railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666;">$ </span>rails generate nifty:layout</div></div>
<p>Now make compatible with Rails 3.1 asset pipeline (assuming this is only temporary until gem is updated for Rails 3.1)</p>
<p>Rename /public/stylesheets/application.css to nifty.css and move to the /app/assets/stylesheets dir<br />
Delete /public/stylesheets<br />
Update javascript to use &#8220;application&#8221; instead of :defaults</p>
<div class="codeheader">/app/views/layouts/application.html.erb</div>
<div class="codecolorer-container ruby railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#006600; font-weight:bold;">&lt;%</span>= javascript_include_tag <span style="color:#996600;">&quot;application&quot;</span> <span style="color:#006600; font-weight:bold;">%&gt;</span></div></div>
<p>Generate the scaffold for a ticket, migrate the schema, and start the server to test locally at http://localhost:3000</p>
<div class="codeheader">Terminal</div>
<div class="codecolorer-container bash railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ rails generate nifty:scaffold ticket name:string description:text<br />
$ bundle <span style="color: #7a0874; font-weight: bold;">exec</span> rake db:migrate<br />
$ rails server</div></div>
<p>Point to our tickets controller as default<br />
Remove public/index.html<br />
Update root route in routes.rb</p>
<div class="codeheader">/config/routes.rb</div>
<div class="codecolorer-container ruby railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">root <span style="color:#ff3333; font-weight:bold;">:to</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'tickets#index'</span></div></div>
<p>Initialise the git repository and perform first commit</p>
<div class="codeheader">Terminal</div>
<div class="codecolorer-container bash railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">git init</span><br />
$ <span style="color: #c20cb9; font-weight: bold;">git add</span> .<br />
$ <span style="color: #c20cb9; font-weight: bold;">git commit</span> <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;Initial commit&quot;</span></div></div>
<p>Create the app on heroku using the cedar stack (its the only stack that currently supports Rails 3.1)</p>
<div class="codeheader">Terminal</div>
<div class="codecolorer-container bash railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ gem <span style="color: #c20cb9; font-weight: bold;">install</span> heroku<br />
$ heroku create <span style="color: #660033;">--stack</span> cedar</div></div>
<p>Notice that there is now a new remote on our git repo</p>
<div class="codeheader">Terminal</div>
<div class="codecolorer-container bash railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666;">$ </span><span style="color: #c20cb9; font-weight: bold;">git remote</span> <span style="color: #660033;">-v</span></div></div>
<p>Heroku uses postgresql by default, update gems</p>
<div class="codeheader">/Gemfile</div>
<div class="codecolorer-container ruby railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">gem <span style="color:#996600;">'sqlite3'</span>, <span style="color:#ff3333; font-weight:bold;">:group</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:development</span><br />
gem <span style="color:#996600;">'pg'</span>, <span style="color:#ff3333; font-weight:bold;">:group</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:production</span></div></div>
<div class="codeheader">Terminal</div>
<div class="codecolorer-container bash railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666;">$ </span>bundle <span style="color: #c20cb9; font-weight: bold;">install</span></div></div>
<p>Commit changes</p>
<div class="codeheader">Terminal</div>
<div class="codecolorer-container bash railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">git add</span> .<br />
$ <span style="color: #c20cb9; font-weight: bold;">git commit</span> <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;Updated database gems to cater for postgresql on Heroku&quot;</span></div></div>
<p>Push app to heroku, migrate the schema on the server, and open a browser to see it running</p>
<div class="codeheader">Terminal</div>
<div class="codecolorer-container bash railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">git push</span> heroku master<br />
$ heroku run rake db:migrate<br />
$ heroku open</div></div>
<h2>Installing the custom domain Add-on</h2>
<p>Notice that it has a unique subdomain, lets give it our own sub-domain name through the Custom Domain add-on</p>
<div class="codeheader">Terminal</div>
<div class="codecolorer-container bash railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">heroku add custom_domain<br />
heroku domains:add tickets.passbyvalue.com</div></div>
<p>Add a CNAME record on the DNS for the preferred subdomain (note that top level domain DNS rules are different) that we want to use and now try it out!</p>
<p>http://tickets.passbyvalue.com</p>
<p>Tutorial: <a href="http://devcenter.heroku.com/articles/custom-domains">http://devcenter.heroku.com/articles/custom-domains</a></p>
<p>Jump into the console and see under the covers</p>
<div class="codeheader">Terminal</div>
<div class="codecolorer-container bash railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666;">$ </span>heroku run console</div></div>
<p>Wow!  How cool is that!  My goal now is to give up my own VPS for hosting my Rails apps.  I&#8217;m thinking that it come out cheaper using Heroku.  </p>
<p><strong>Note:</strong> there are some limitations that you need to be aware of.  For example you have limited write access to the file system so if you want your users to upload images then you need to incorporate different cloud offerings for this to work, like Amazon S3.  The paperclip gem has support for this.  This gives an insight in how your thinking has to change when you start to leverage cloud services and augment them together.  Something to discuss further another time&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://passbyvalue.com/2011/11/getting-started-with-heroku-and-rails-3-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Version controlling WordPress themes on simple hosts</title>
		<link>http://passbyvalue.com/2010/07/version-controlling-wordpress-themes-on-simple-hosts/</link>
		<comments>http://passbyvalue.com/2010/07/version-controlling-wordpress-themes-on-simple-hosts/#comments</comments>
		<pubDate>Sat, 17 Jul 2010 12:12:07 +0000</pubDate>
		<dc:creator>Trent</dc:creator>
				<category><![CDATA[Software development]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://passbyvalue.com/?p=177</guid>
		<description><![CDATA[Here&#8217;s a quick tip if your WordPress host is quite simple and only provides FTP access and no version control tools (svn, git) or specific syncing tools (rsync) Use version control for the theme on your local machine (where you run your dev WordPress environment), then use syncing capability of FTP tool (Cyberduck for MacOSX [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick tip if your WordPress host is quite simple and only provides FTP access and no version control tools (svn, git) or specific syncing tools (rsync)</p>
<p>Use version control for the theme on your local machine (where you run your dev WordPress environment), then use syncing capability of FTP tool (<a href="http://cyberduck.ch/">Cyberduck</a> for MacOSX has this feature) to promote the changes to your host.</p>
<p>Remember, version control is the only way to sensibly manage changes to your theme &#8211; editing through the WordPress theme editor on your host is a really bad way to manage it!</p>
]]></content:encoded>
			<wfw:commentRss>http://passbyvalue.com/2010/07/version-controlling-wordpress-themes-on-simple-hosts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git repositories with Slicehost</title>
		<link>http://passbyvalue.com/2009/12/git-repositories-with-slicehost/</link>
		<comments>http://passbyvalue.com/2009/12/git-repositories-with-slicehost/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 11:31:09 +0000</pubDate>
		<dc:creator>Trent</dc:creator>
				<category><![CDATA[Software development]]></category>
		<category><![CDATA[capistrano]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[scm]]></category>
		<category><![CDATA[slicehost]]></category>

		<guid isPermaLink="false">http://passbyvalue.com/?p=157</guid>
		<description><![CDATA[No doubt I am really happy with my Slicehost VPS, it has been so hassle free!  The best part about Slicehost is all the amazing articles they provide to help you get going with your slice. I&#8217;ve setup my slice to host my private git repositories, particularly since I wanted to use them with Rails [...]]]></description>
			<content:encoded><![CDATA[<p>No doubt I am really happy with my <a href="http://www.slicehost.com">Slicehost</a> VPS, it has been so hassle free!  The best part about Slicehost is all the amazing articles they provide to help you get going with your slice.</p>
<p>I&#8217;ve setup my slice to host my private git repositories, particularly since I wanted to use them with Rails and Capistrano.  This article provide to be just what I needed:</p>
<p><a href="http://articles.slicehost.com/2009/5/13/capistrano-series-setting-up-git">http://articles.slicehost.com/2009/5/13/capistrano-series-setting-up-git</a></p>
<p>The article even shows you how to secure the shell that the git user has to avoid anyone SSHing into your box with their ID.  However, it doesn&#8217;t tell you what to do when you want to create another repository as you cannot switch to the git user while ever it is using the git-shell as opposed to a normal shell.  The trick is you need to switch with the root user as only they are allowed to provide an alternative shell.  Here are the commands once you have logged into your slice with a user that is able to sudo:</p>
<div class="codecolorer-container bash railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">su</span> <span style="color: #660033;">--shell</span> <span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">bash</span> <span style="color: #c20cb9; font-weight: bold;">git</span><br />
$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">git</span><br />
$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> project2<br />
$ <span style="color: #7a0874; font-weight: bold;">cd</span> project2<br />
$ <span style="color: #c20cb9; font-weight: bold;">git</span> <span style="color: #660033;">--bare</span> init<br />
$ <span style="color: #7a0874; font-weight: bold;">exit</span></div></div>
<p>Now your repository is good to go and you can follow the steps from &#8220;Making your first commit&#8221; section.</p>
]]></content:encoded>
			<wfw:commentRss>http://passbyvalue.com/2009/12/git-repositories-with-slicehost/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git for dummies</title>
		<link>http://passbyvalue.com/2009/01/git-for-dummies/</link>
		<comments>http://passbyvalue.com/2009/01/git-for-dummies/#comments</comments>
		<pubDate>Sat, 31 Jan 2009 06:41:44 +0000</pubDate>
		<dc:creator>Trent</dc:creator>
				<category><![CDATA[Software development]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[scm]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://blog.passbyvalue.com/?p=45</guid>
		<description><![CDATA[Only just started to finally get stuck into learning git. It certainly seems to be revolutionising the way we do version control. I&#8217;m pretty hooked on subversion and I have to admit, I thought that was as good as it gets! But the hype around git to much to ignore. Here&#8217;s some resources I&#8217;ve found [...]]]></description>
			<content:encoded><![CDATA[<p>Only just started to finally get stuck into learning <a href="http://git-scm.com/">git</a>.  It certainly seems to be revolutionising the way we do version control.  I&#8217;m pretty hooked on <a href="http://subversion.tigris.org/">subversion</a> and I have to admit, I thought that was as good as it gets!  But the hype around git to much to ignore.</p>
<p>Here&#8217;s some resources I&#8217;ve found really useful to get (git) going:</p>
<h3>Resources</h3>
<ul>
<li><a href="http://feeds.feedburner.com/Gitcasts">GitCasts</a> by Scott Chacon.  Screencasts are for me one of the best ways to learn things, these casts, although very quick, give you that good leg up.</li>
<li><a href="http://www.newartisans.com/blog/2008/04/git-from-the-bottom-up.html">Git from the bottom up</a> by John Wiegley.  There is a link from his blog entry to a paper he has put together on his understanding of Git.  Always good to read some theory!</li>
<li><a href="http://git-scm.com/course/svn.html">Git &#8211; SVN crash course</a> from the offical git site.  A great place to start if like me, you&#8217;re already familiar with svn.</li>
<li>Github&#8217;s <a href="http://github.com/guides/git-cheat-sheet">Git Cheat Sheet</a> is a good resource too!</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://passbyvalue.com/2009/01/git-for-dummies/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Accessing github from behind a proxy</title>
		<link>http://passbyvalue.com/2009/01/accessing-github-from-behind-a-proxy/</link>
		<comments>http://passbyvalue.com/2009/01/accessing-github-from-behind-a-proxy/#comments</comments>
		<pubDate>Fri, 02 Jan 2009 04:11:36 +0000</pubDate>
		<dc:creator>Trent</dc:creator>
				<category><![CDATA[Software development]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[proxy]]></category>

		<guid isPermaLink="false">http://blog.passbyvalue.com/?p=40</guid>
		<description><![CDATA[If you&#8217;re behind a proxy which restricts outbound ports (i.e. only port 80 and 443), then you&#8217;ll be pleased to know that you can still access Github. Rather than using the git:// protocol (defaulting to port 9418), you can use the HTTP protocol to do the same thing! Article on Github about it here. git [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re behind a proxy which restricts outbound ports (i.e. only port 80 and 443), then you&#8217;ll be pleased to know that you can still access <a href="http://github.com/">Github</a>.</p>
<p>Rather than using the git:// protocol (defaulting to port <a href="http://www.kernel.org/pub/software/scm/git/docs/git-daemon.html">9418</a>), you can use the HTTP protocol to do the same thing!  Article on Github about it <a href="http://github.com/blog/92-http-cloning">here</a>.</p>
<pre lang="bash">git clone http://github.com/justinfrench/formtastic.git</pre>
<p>It also works for Rails plugins!</p>
<pre lang="bash">script/plugin install http://github.com/justinfrench/formtastic.git</pre>
<p>Don&#8217;t forgot you need to set environment variable <span style="font-weight: bold;">http_proxy</span> to tell Git to use the proxy or or can set it in git-config.  The example below sets it at the global level:</p>
<pre lang="bash">git config --global --add http.proxy http://myproxy:8080</pre>
]]></content:encoded>
			<wfw:commentRss>http://passbyvalue.com/2009/01/accessing-github-from-behind-a-proxy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

