<?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>Ben Atkin&#039;s Self-Hosted Blog &#187; git</title>
	<atom:link href="http://benatkin.com/tag/git/feed/" rel="self" type="application/rss+xml" />
	<link>http://benatkin.com</link>
	<description>My true voice on the Internet.</description>
	<lastBuildDate>Wed, 23 May 2012 07:59:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Keeping locally precompiled assets out of the way on Heroku</title>
		<link>http://benatkin.com/2011/10/30/locally-precompiled-assets-and-heroku/</link>
		<comments>http://benatkin.com/2011/10/30/locally-precompiled-assets-and-heroku/#comments</comments>
		<pubDate>Sun, 30 Oct 2011 11:31:28 +0000</pubDate>
		<dc:creator>Ben Atkin</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[asset pipeline]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[heroku]]></category>
		<category><![CDATA[rails 3.1]]></category>

		<guid isPermaLink="false">http://benatkin.com/?p=1002</guid>
		<description><![CDATA[With the Rails 3.1 Asset Pipeline, there&#8217;s the rake assets:precompile command which precompiles assets into public/assets along with a manifest.yml file which rails uses to put the paths to the assets in its templates. Precompiling generates a few files, which &#8230; <a href="http://benatkin.com/2011/10/30/locally-precompiled-assets-and-heroku/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>With the Rails 3.1 Asset Pipeline, there&#8217;s the rake assets:precompile command which precompiles assets into <code>public/assets</code> along with a <code>manifest.yml</code> file which rails uses to put the paths to the assets in its templates. Precompiling generates a few files, which can clutter commit logs if they&#8217;re committed. For this reason I might add <code>public/assets</code><code> to my </code><code>.gitignore</code> and build them on the server, rather than committing them to git and uploading them. Or, if the server had trouble compiling them, I might precompile them locally, and scp them up rather than committing them to git, because they can make a lot of noise in my git logs.</p>
<p>On Heroku, though, git is the only way to deploy. So if I&#8217;m having trouble having heroku precompile them, I need to commit them and push them via git. This could clutter up my commit log.</p>
<p>There is a way around this, though: use a branch! If I create a branch just for heroku, and just commit them to the branch, I can keep my commit logs free of changes to <code>public/assets</code>.</p>
<p>Here is a sketch of this process:</p>
<ol>
<li>Add <code>public/assets</code> to my <code>.gitignore</code> and commit it</li>
<li>Create a heroku branch with <code>git checkout -b heroku</code>
</li>
<li>remove <code>public/assets</code> from my <code>.gitignore</code> and commit it. This just affects my heroku branch.</li>
<li>Run <code>RAILS_ENV=production rake assets:precompile</code> there.</li>
<li>Run <code>git add .</code> and <code>git commit -m 'precompile assets'</code> to commit the files to my heroku branch</li>
<li>Run <code>git push heroku heroku:master</code> to push my heroku branch to heroku as master (heroku only uses the master branch)</li>
<li>Run <code>git checkout master</code> and continue development on my master branch.</li>
</ol>
<p>A deploy rake script could be used to automate this.</p>
<p>The heroku branch wouldn&#8217;t need to be pushed to github, because it doesn&#8217;t contain any information that can&#8217;t be regenerated. The only reason the history would need to be preserved is so it can be cleanly pushed to the heroku app. Fortunately, if the local repo was lost, it&#8217;s possible to pull from the heroku repository. Heroku shouldn&#8217;t be used as a place to store git repositories because the lifecycle for a heroku app is often different than that of a repository. For this purpose, though, the usefulness of the old assets commits is tied to the life of the Heroku app so it works out well.</p>
]]></content:encoded>
			<wfw:commentRss>http://benatkin.com/2011/10/30/locally-precompiled-assets-and-heroku/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Partially merging a branch with git</title>
		<link>http://benatkin.com/2009/01/26/partially-merging-with-git/</link>
		<comments>http://benatkin.com/2009/01/26/partially-merging-with-git/#comments</comments>
		<pubDate>Mon, 26 Jan 2009 22:36:44 +0000</pubDate>
		<dc:creator>Ben Atkin</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[version control]]></category>

		<guid isPermaLink="false">http://www.benatkin.com/weblog/?p=219</guid>
		<description><![CDATA[The other day I went back to an old branch that had about five files that were changed and I only wanted to incorporate two of them into my master branch. In order to just merge in a couple, I &#8230; <a href="http://benatkin.com/2009/01/26/partially-merging-with-git/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The other day I went back to an old branch that had about five files that were changed and I only wanted to incorporate two of them into my master branch. In order to just merge in a couple, I used <em>git merge</em> with the <em>&#8211;no-commit</em> option.</p>
<pre class="prettyprint" style="border: none">git merge --no-commit planner</pre>
<p>This merges in all changes but doesn&#8217;t commit it. Since it isn&#8217;t committed, it&#8217;s easy to roll back individual files. I ran <em>git status</em> to get a list of files and rolled back several files with <em>git checkout</em>. When I was done, I had only the two files I wanted to merge showing up when I ran <em>git status</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://benatkin.com/2009/01/26/partially-merging-with-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

