<?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>Postpostmodern &#187; Git</title>
	<atom:link href="http://postpostmodern.com/tag/git/feed/" rel="self" type="application/rss+xml" />
	<link>http://postpostmodern.com</link>
	<description>Speaking of web development.</description>
	<lastBuildDate>Tue, 08 Jun 2010 18:46:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Git Yr Remote Set Up</title>
		<link>http://postpostmodern.com/instructional/git-yr-remote-set-up/</link>
		<comments>http://postpostmodern.com/instructional/git-yr-remote-set-up/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 01:46:02 +0000</pubDate>
		<dc:creator>Jason Johnson</dc:creator>
				<category><![CDATA[Instructional]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://postpostmodern.com/?p=323</guid>
		<description><![CDATA[Set up a remote git repo and git user on Ubuntu.]]></description>
			<content:encoded><![CDATA[<h2>Last week&#8230;</h2>

<dl>
<dt>Jason</dt>
<dd>I started using Unfuddle for <em>[redacted]</em></dd>

<dd>I like it so far.</dd>

<dt><a href="http://treypiepmeier.com">Trey</a></dt>
<dd>it&#8217;s a good service</dd>

<dd>I&#8217;m going to move all my private repos there</dd>

<dt>Jason</dt>
<dd>if you just want online repo storage, why not just use your Slice?</dd>

<dt><a href="http://treypiepmeier.com">Trey</a></dt>
<dd>I should do that</dd>

<dt>Jason</dt>
<dd>It&#8217;s super easy</dd>

<dt><a href="http://treypiepmeier.com">Trey</a></dt>
<dd>yeah?</dd>

<dd>you should blog it</dd>

<dt>Jason</dt>
<dd>ok.</dd>
</dl>

<h2>So here is how to get your remote git up and go</h2>

<h3>Setting up a remote Git repo and connecting via ssh in a nutshell:</h3>

<p>First, we install git on the server. I&#8217;m using aptitude on Ubuntu for this. Next, we have two options: we can just set up a bare git repo and push to it using an existing user; or, if we want to be able to safely share the repo with others, we can set up a git user. After setting up the git user, we create the bare git repo, chown it to the git user, and push to it from our local machine.</p>

<h3>On your slice&#8230;</h3>

<ol>
<li><p>Install Git</p>

<p><kbd class="block">sudo aptitude git-core</kbd></p></li>
<li><p>Add the Git User (If you want to use an existing user, skip to step #7.)</p>

<p><kbd class="block">sudo adduser git</kbd></p></li>
<li><p>Set up ssh key (standard procedure)</p>

<p><kbd class="block">su - git</kbd>
<kbd class="block">mkdir .ssh</kbd>
<kbd class="block">chmod 700 .ssh</kbd>
<kbd class="block">nano -w ~/.ssh/authorized_keys</kbd></p>

<p>(Yes, I use nano. What of it?)</p>

<p><em>[ paste in public key and save the file ]</em></p></li>
<li><p>Exit su</p>

<p><kbd class="block">exit</kbd></p></li>
<li><p>Give the Git User a special shell that only allows git commands</p>

<p><kbd class="block">sudo nano /etc/passwd</kbd></p>

<p><em>[ Change git&#8217;s shell from <code>/bin/sh</code> to <code>/usr/bin/git-shell</code> ]</em></p>

<p><em>[ Save /etc/passwd ]</em></p></li>
<li><p>If you have set up your sshd_config to only allow specific users, you&#8217;ll need to add git</p>

<p><kbd class="block">sudo nano /etc/ssh/sshd_config</kbd></p>

<p><em>[ Add git to AllowUsers (near the end of the file), e.g.: AllowUsers jason git ]</em></p></li>
<li><p>Reload sshd</p>

<p><kbd class="block">sudo /etc/init.d/ssh reload</kbd></p></li>
<li><p>Create a dir for your repos</p>

<p><kbd class="block">sudo mkdir /var/git</kbd></p>

<p><kbd class="block">sudo chown &#96;whoami&#96; /var/git</kbd></p></li>
<li><p>Create your first bare repo (<code>--bare</code> means no working dir; i.e. just the contents of .git)</p>

<p><kbd class="block">cd /var/git</kbd>
<kbd class="block">mkdir test.git</kbd>
<kbd class="block">cd test.git</kbd>
<kbd class="block">git --bare init</kbd>
<kbd class="block">sudo chown -R git .</kbd></p></li>
</ol>

<h3>Back on your local machine&#8230;</h3>

<ol>
<li><p>Go to there</p>

<p><kbd class="block">cd /path/to/test</kbd></p></li>
<li><p>Add your remote (just as if it were somewhere like Github)</p>

<p><kbd class="block">git remote add origin ssh://git@slice1.example.com/var/git/test.git</kbd></p></li>
<li><p>Push all your branches</p>

<p><kbd class="block">git push --all</kbd></p></li>
</ol>

<h2>N.B.</h2>

<ul>
<li>If you use something other than Ubuntu and aptitude, your git-shell may be located somewhere else. Try <kbd>which git-shell</kbd> to find it.</li>
<li>If you&#8217;ve changed your ssh port to something other than 22, you&#8217;ll need to do something like this: 
<kbd class="block">git remote add origin ssh://git@slice1.example.com:8822/var/git/test.git</kbd></li>
<li>To allow others to contribute, put their public key in <code>/home/git/.ssh/authorized_keys</code>, but remember, you can&#8217;t log in as git; so, you&#8217;ll need to edit it as root with sudo.</li>
</ul>

<p>Questions? Comments? Recommendations? Let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://postpostmodern.com/instructional/git-yr-remote-set-up/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Gitup!</title>
		<link>http://postpostmodern.com/downloadable/gitup/</link>
		<comments>http://postpostmodern.com/downloadable/gitup/#comments</comments>
		<pubDate>Sun, 01 Feb 2009 18:49:34 +0000</pubDate>
		<dc:creator>Jason Johnson</dc:creator>
				<category><![CDATA[Downloadable]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Transmit]]></category>

		<guid isPermaLink="false">http://postpostmodern.com/?p=296</guid>
		<description><![CDATA[Gitup + Transmit = Really Simple Publishing]]></description>
			<content:encoded><![CDATA[<p>Gitup + Transmit = Really Simple Publishing</p>

<h2>Deploy vs Publish</h2>

<p>There are many ways to deploy a new version of a web site. If it&#8217;s a web app, you normally want to use a complete deployment solution like <a href="http://www.capify.org/">Capistrano</a> or <a href="http://blog.railsmachine.com/articles/2009/01/16/moonshine-configuration-management-and-deployment/">Moonshine</a>. But if you need to update a static HTML site or a simple PHP site, you usually just need to upload the changed files. This is often referred to as <em>publishing</em> as opposed to <em>deployment</em>. There are obviously several ways of doing this. Many file transfer apps have synchronization features. Publishing features can also be found in many editors/IDEs.</p>

<h2>The Pain of Publishing</h2>

<p>I&#8217;m a simple man. All those fancy publish/sync features always seem to be a hassle or else they&#8217;re built-in to a less-than-ideal coding environment (I&#8217;m looking at you, <a href="http://www.panic.com/coda/">Coda</a> and <a href="http://macrabbit.com/espresso/features/publish/">Espresso</a>). Editing in Textmate and dock-sending to Transmit is about as fancy as I get. No sync. Just uploading files. The problem is, it&#8217;s hard sometimes to keep track of all the updated files that need to be uploaded once a new page is added, feature is complete, etc. Git knows what&#8217;s changed (if you&#8217;re not using <a href="http://git-scm.com/">Git</a> or some other SCM, you should be), but going through the logs is a pain.</p>

<h2>Gitup and Go</h2>

<p>So, yesterday, I wrote a Ruby script to do simple publishing. It&#8217;s called <a href="http://github.com/postpostmodern/gitup/tree/master">Gitup</a>. You tell Gitup which Git commits you want to publish, and it finds all of the changed files and sends them to Transmit. If you have Transmit&#8217;s dock send feature set up, Transmit will upload the files to the appropriate server and directory. Gitup will even let you preview the list of files that it plans on uploading.</p>

<p>It&#8217;s super-simple and quick. Much quicker than any &#8216;publish&#8217; feature I&#8217;ve seen.</p>

<h2>Examples</h2>

<p>Send files modified in the last commit to Transmit (Gitup will let you know how many files will be sent and offer you the option to view a list of the files or abort.):</p>

<p><kbd class="block">gitup</kbd></p>

<p>Send files modified in the last 3 commits to Transmit:</p>

<p><kbd class="block">gitup -3</kbd></p>

<p>Send files modified in the last 3 commits to Transmit immediately (no prompting or anything):</p>

<p><kbd class="block">gitup -s -3</kbd></p>

<p>Send files modified since yesterday to Transmit:</p>

<p><kbd class="block">gitup --since=yesterday</kbd></p>

<p>Send files modified since Monday to Transmit (quotes are required):</p>

<p><kbd class="block">gitup --since="last monday"</kbd></p>

<p>Send files since the specified commit to Transmit:</p>

<p><kbd class="block">gitup dcd2c68..</kbd></p>

<p>Open files added/updated between the two specified commits in Textmate:</p>

<p><kbd class="block">gitup --application=Textmate dcd2c68..bf75dd6</kbd></p>

<h2>Disclaimer</h2>

<p><em>Please note that Gitup is brand new. It could be buggy. I&#8217;m just sayin&#8217;.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://postpostmodern.com/downloadable/gitup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
