<?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>Abizern.org &#187; git</title>
	<atom:link href="http://abizern.org/tag/git/feed/" rel="self" type="application/rss+xml" />
	<link>http://abizern.org</link>
	<description>The personal and developer blog of a Mac developer in London.</description>
	<lastBuildDate>Thu, 02 Sep 2010 01:47:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>August NSCoder Night — Now With Talks</title>
		<link>http://abizern.org/2010/08/05/nscoder-night-with-talks/</link>
		<comments>http://abizern.org/2010/08/05/nscoder-night-with-talks/#comments</comments>
		<pubDate>Thu, 05 Aug 2010 15:20:43 +0000</pubDate>
		<dc:creator>Abizer</dc:creator>
				<category><![CDATA[Mac Development]]></category>
		<category><![CDATA[NSCoder Night]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[nscodernight]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[social]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://abizern.org/?p=361</guid>
		<description><![CDATA[Let&#8217;s try and add something new to our NSCoder Nights — talks. Our evenings don&#8217;t usually follow the norm of people all sat down and coding. I suppose that&#8217;s because of the choice of venue, but who would turn up for an evening in Starbucks? I&#8217;ve got a couple of volunteers lined up for the [...]]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s try and add something new to our NSCoder Nights — talks.</p>
<p>Our evenings don&#8217;t usually follow the norm of people all sat down and coding. I suppose that&#8217;s because of the choice of venue, but who would turn up for an evening in Starbucks?</p>
<p>I&#8217;ve got a couple of volunteers lined up for the next couple of meetings, but I thought it would be a good idea to put some draft ground rules down.</p>
<p><strong>For Presenters:</strong></p>
<p>Keep talks short and focussed. 15-20 minutes should be enough time. Think of it as being an initiator of the discussion that might follow.</p>
<p>Forget about any audio-video support. We are in a pub, where there are other people around. A few slides on your laptop or iPad is the most you have to work with. If you do a slideshow I&#8217;ll happily host the slides or post a link back to where you have them.</p>
<p>Don&#8217;t be offended if not everyone listens to your presentation, or scuttle of during it. Some people are just not interested in the topic, or are having a more interesting discussion somewhere else. The talks are not the point of the evening, just something that happens during the evening.</p>
<p>Be prepared to expand upon and explain your ideas further if someone asks.</p>
<p><strong>For Listeners:</strong></p>
<p>Don&#8217;t feel you have to listen to the talk if you don&#8217;t want to, but please don&#8217;t have a conversation over it. If you start listening and decide to bail, do so in the least disruptive way possible.</p>
<p>Ask questions, make comments, ask for help with related code. The presentations are necessarily short, but that doesn&#8217;t mean you can&#8217;t keep talking about the topic.</p>
<p>If you feel you have something to talk about, let me know and I&#8217;ll add you to the list.</p>
<p><strong>Upcoming Talks:</strong></p>
<p>August &#8211; <a href="http://twitter.com/richardbuckle">Richard Buckle</a> on Test Driven Development<br />
September &#8211; <a href="http://twitter.com/alblue">Alex Blewitt</a> on Git/DVCS</p>
<p>If anyone has any amendments to propose for these rules or have subjects for talks, please let me know. See you on August 17th.</p>
]]></content:encoded>
			<wfw:commentRss>http://abizern.org/2010/08/05/nscoder-night-with-talks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A Year of Git</title>
		<link>http://abizern.org/2010/03/24/a-year-of-git/</link>
		<comments>http://abizern.org/2010/03/24/a-year-of-git/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 16:52:31 +0000</pubDate>
		<dc:creator>Abizer</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[365git]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tumblr]]></category>

		<guid isPermaLink="false">http://abizern.org/?p=331</guid>
		<description><![CDATA[I’ve been inspired by Pieter Omvlee of Bohemian Coding and his 365Cocoa to set up my own contribution. I’m going to try and and fill a year with git tips and inspirations over at 365git. I’ve got a few weeks worth of ideas but if anyone wants to know anything or has a suggestion, I’ll [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve been inspired by Pieter Omvlee of <a href="http://bohemiancoding.com">Bohemian Coding</a> and his <a href="http://365Cocoa.tumblr.com">365Cocoa</a> to set up my own contribution.</p>
<p>I’m going to try and and fill a year with <a href="http://git-scm.com">git</a> tips and inspirations over at <a href="http://365git.tumblr.com">365git</a>. I’ve got a few weeks worth of ideas but if anyone wants to know anything or has a suggestion, I’ll gratefully consider them.</p>
]]></content:encoded>
			<wfw:commentRss>http://abizern.org/2010/03/24/a-year-of-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Three ways of excluding files from git</title>
		<link>http://abizern.org/2010/02/07/three-ways-of-excluding-files-from-git/</link>
		<comments>http://abizern.org/2010/02/07/three-ways-of-excluding-files-from-git/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 18:52:32 +0000</pubDate>
		<dc:creator>Abizer</dc:creator>
				<category><![CDATA[Mac Development]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[exclude]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[ignore]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://abizern.org/?p=278</guid>
		<description><![CDATA[Almost every git user knows about adding a .gitignore file to their repository to control the visibility of files and folders. This per project configuration will apply to all repositories of the same code base. But it’s not the only way. I’m going to tell you how to get git to ignore files on a [...]]]></description>
			<content:encoded><![CDATA[<p>Almost every git user knows about adding a <code>.gitignore</code> file to their repository to control the visibility of files and folders. This per project configuration will apply to all repositories of the same code base. But it’s not the only way. I’m going to tell you how to get <a title="http://git-scm.com" href="http://git-scm.com">git</a> to ignore files on a per computer and per repository basis. These could be better choices in some circumstances.</p>
<p>There are three types of exclude files; from highest to lowest order of precedence they are:</p>
<h2>Per Project: .gitignore file in the repository</h2>
<p>This is the usual way of adding an ignore file. Call it <code>.gitignore</code> and save it to the root of your project to apply to all the files (you can add different <code>.gitignore</code> files in subdirectories where they have lesser scope). It is a part of the repository, so it will need to be <code>git-add</code>ed and committed for each change. This is useful for repositories that are passed around with others who may not have a per computer exclude file, or when there are project specific files that need to be taken into account. Even easier if you have per computer file, you can copy it straight in to your project with a simple <code>cp ~/.gitignore .gitignore</code> and edit to handle your specific requirements.<br />
<h2>Per Repository: in .git/info/excludes</h2>
<p>You can exclude files on a per repository basis by editing the <code>.git/info/excludes</code> file in your repository. (Why it takes it from this location rather than <code>.git/config</code> I don’t know: add it to the list of git annoyances). These exclusions (or inclusions, you can override the higher level exclusions by prepending <code>!</code> to lines that you want to include) are not shared with the working directory, so they only apply to that particular repository. This is useful when you have particular requirements because of your workflow or machine setup.</p>
<h2>Per Computer: through ~/.gitconfig settings</h2>
<p>There should already be a <code>.gitconfig</code> file in your home directory. This is where the global setting for your git installation are stored; such as the user’s name and email address. Within this you can set a path to an excludes file that will apply to all git repositories on the computer in the same way as the name and email defined in this file apply to all repositories.</p>
<p>For example: Most of what I do is in <a title="Apple's Xcode site" href="http://developer.apple.com/tools/xcode/">Xcode</a> so I have the following ~/.gitignore file</p>
<div class="code">
<p># ~/.gitignore</p>
<p>*.DS_Store<br />
*.pbxuser<br />
*.mode1v3<br />
*.mode2v3<br />
*.perspectivev3</p>
</div>
<p>And in my <code>.gitconfig</code> file under the <code>[core]</code> section I have added the path to this file for the <code>excludesfile</code> key. (If you’re sharp eyed, you’ll notice that I don’t have an exclusion for <code>/build</code>. That’s because I don’t keep my products in my project directory, but that’s for a different post).</p>
<div class="code">
<p>&lt;snip&gt;…<br />
<span style="color: #dd0000;">[</span><span style="color: #003369;">core</span><span style="color: #dd0000;">]</span><br />
editor = /usr/bin/see -w -r -o new-window -j ‘git editor’ -m gitCommit -g 1:0<br />
excludesfile = /Users/abizern/.gitignore<br />
&lt;snip&gt;…</p>
</div>
<p>Now, I have a standard set of ignores that apply to all my git repositories on this machine without me having to add a specific <code>.gitignore</code> file to each one. This is probably most useful if you create a lot of repositories for yourself, but I recommend it to everyone. It’s lowest on the precedence scale and provides a neat catch-all.</p>
<h2>Summary</h2>
<p>Most of the time the first solution is quite adequate, having exclusions with a repository that is likely to have a public face is probably the most effective way of managing file visibility. But, as with most of git, there are ways of handling edge cases. You just need to know that they are there.</p>
<p><strong>REFERENCE:</strong> the <a title="gitignore(5) Man page on git-scm.com" href="http://www.kernel.org/pub/software/scm/git/docs/gitignore.html">gitignore</a> man page.</p>
]]></content:encoded>
			<wfw:commentRss>http://abizern.org/2010/02/07/three-ways-of-excluding-files-from-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some tips for lazy Xcoders</title>
		<link>http://abizern.org/2009/11/11/some-tips-for-lazy-xcoders/</link>
		<comments>http://abizern.org/2009/11/11/some-tips-for-lazy-xcoders/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 12:40:53 +0000</pubDate>
		<dc:creator>Abizer</dc:creator>
				<category><![CDATA[Mac Development]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[clang]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[commits]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://www.stompy.org/?p=177</guid>
		<description><![CDATA[We all know what we should be doing when writing code. Each methodology you choose to use has it&#8217;s own best practices, whether it&#8217;s working from full specifications, writing unit tests first, programming in pairs, yadda, yadda. But, as developers, we&#8217;re only human, and we&#8217;re lazy. We have tools to make things easy for us. [...]]]></description>
			<content:encoded><![CDATA[<p>We all know what we should be doing when writing code. Each methodology you choose to use has it&#8217;s own best practices, whether it&#8217;s working from full specifications, writing unit tests first, programming in pairs, yadda, yadda. But, as developers, we&#8217;re only human, and we&#8217;re lazy. We have tools to make things easy for us. Here are a few tips that you can use to help when you&#8217;re not as rigorous in your coding as you should be.</p>
<h2>Use a static analyser.</h2>
<p>You can use the <a href="http://arstechnica.com/apple/reviews/2009/08/mac-os-x-10-6.ars/9#compilers">Clang Static Analyser</a> in Xcode by setting a build option. This will find a whole host of errors in your code, even down to unconventionally named functions.</p>
<p><img src="http://abizern.org/wp-content/uploads/2009/11/ClangBuildSetting.png" alt="ClangBuildSetting.png" width="502" height="122" /></p>
<p>Now you can just code away and have the compiler pick up your mistakes when you run &#8216;Build and Analyze&#8217; (Shift ⌘ A).</p>
<h2>Find your mistakes quickly</h2>
<p>Any real application you develop will have a large number of resources that need to be copied to your application bundle. The default projects that Xcode create for you will copy these files first before compiling.</p>
<p><img src="http://abizern.org/wp-content/uploads/2009/11/XcodeDefault.png" alt="XcodeDefault.png" width="232" height="88" /></p>
<p>But, the lazy Xcoder knows that there are probably errors in the code that need to get flagged by the compiler, so this copying is a waste of time. Reorder the build steps by dragging so that the compilation is done first.</p>
<p><img src="http://abizern.org/wp-content/uploads/2009/11/XcodeRecommended.png" alt="XcodeRecommended.png" width="219" height="86" /></p>
<p>Your builds will now break early (and often!).</p>
<h2>Don&#8217;t fear the version controller</h2>
<p>I&#8217;m going to stick my neck out and say that if you&#8217;re not using version control you&#8217;re an idiot. The lazy Xcoder uses a powerful system that lets him or her branch easily, make lots of little changes, and lots of mistakes (that can be backed out). These changes can then be bundled into larger commits to be merged into the main branch so that your co-workers don&#8217;t see what an idiot you&#8217;ve been.</p>
<p>One such version control system is <a href="http://git-scm.com/">git</a>. The lazy Xcoder writes a bit of code, checks it in out of habit and then compiles. The compiler picks up the mistakes, and he or she fixes them. Rather than make a new commit, and retype the commit message, just call:</p>
<p><code>git commit --amend -a -C HEAD</code></p>
<p>This will bring up the previous commit message in the editor, which you can amend if you wish. This new commit will replace the previous one. The <code>-a</code> option means you don&#8217;t even need to do a git add and the <code>-C HEAD</code> option means it will use the commit message from the last commit.</p>
<p>Of course, if you&#8217;re a rockstar programmer, you don&#8217;t make mistakes at this level. But I&#8217;m not, and I prefer to work with human nature rather than against it.</p>
]]></content:encoded>
			<wfw:commentRss>http://abizern.org/2009/11/11/some-tips-for-lazy-xcoders/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Integrating git with SubEthaEdit and Changes.app</title>
		<link>http://abizern.org/2009/11/08/integrating-git-with-subethaedit-and-changes/</link>
		<comments>http://abizern.org/2009/11/08/integrating-git-with-subethaedit-and-changes/#comments</comments>
		<pubDate>Sun, 08 Nov 2009 16:41:02 +0000</pubDate>
		<dc:creator>Abizer</dc:creator>
				<category><![CDATA[Mac Development]]></category>
		<category><![CDATA[changes_app]]></category>
		<category><![CDATA[diff]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[mercurial]]></category>
		<category><![CDATA[subethaedit]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://www.stompy.org/?p=160</guid>
		<description><![CDATA[A while ago, I read a nice write up about using mercurial with SubEthaEdit and Changes. Here&#8217;s how to do the same thing with git instead of mercurial, separated into two parts in case you just want to apply one set of changes. Changes Support Step One: Make sure chdiff is installed. Open Changes.app and [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago, I read a <a href="http://schinckel.net/2008/04/26/mercurial-with-os-x-gui-tools/">nice write up</a> about using <a href="http://mercurial.selenic.com/">mercurial</a> with <a href="http://www.codingmonkeys.de/subethaedit/" title="Text editor from the Coding Monkeys">SubEthaEdit</a> and <a href="http://connectedflow.com/changes/" title="Diff viewer from Connected Flow">Changes</a>. Here&#8217;s how to do the same thing with <a href="http://git-scm.com/" title="Distributed Version Control System">git</a> instead of <a href="http://mercurial.selenic.com/">mercurial</a>, separated into two parts in case you just want to apply one set of changes.</p>
<h2>Changes Support</h2>
<p><strong>Step One: Make sure chdiff is installed.</strong></p>
<p>Open Changes.app and from the Changes menu select &#8220;Install terminal utility&#8221;. This will install the chdiff utility which is used by the script.
<p><strong>Step Two: Create a shell script to send diffs to Changes</strong>
<p>Create a shell script with the following contents.</p>
<div class="code"><span style="color:#236e25;"><em>#!/bin/sh<br />
</em></span>[ <span style="color:#c4620a;">$#</span> -eq <span style="color:#0000ff;">7</span> ] &amp;&amp; /usr/bin/env chdiff <span style="color:#760f15;">&quot;</span><span style="color:#c4620a;">$2</span><span style="color:#760f15;">&quot;</span> <span style="color:#760f15;">&quot;</span><span style="color:#c4620a;">$5</span><span style="color:#760f15;">&quot;</span></div>
<p>Where you save this and what you call it is up to you. Mine is called &#8216;.gitchanges&#8217;, saved it at the root of my home directory. Make sure the script is executable.</p>
<p><strong>Step Three: Edit the .gitconfig file to use this script to handle diffs.</strong></p>
<p>Open your <code>~/.gitconfig</code> file. This should already exist, at the very least it will contain you name and email. under the section called <code>[diff]</code> add the location and name of the file.  You may have to edit this to make sure it points to the name and location you chose in Step Two. (Make sure to use the correct path in your setup)</p>
<div class="code"><span style="color:#dd0000;">[</span><span style="color:#003369;">diff</span><span style="color:#dd0000;">]</span><br />
external = <span style="color:#881280;">&lt;path to file&gt;</span>/.gitchanges</div>
<h2>SubEthaEdit Support</h2>
<p><strong>Step One: Download and install the mode file for SubEthaEdit</strong>
</p>
<p>I wrote a SubEthaEdit mode for this which you can download from the <a href="http://abizern.github.com/gitcommit.mode/" title="GitHub Project page">github project page</a>. Please feel free to fork it and send me patches.</p>
<p><strong>Step Two: Edit the .gitconfig file to use SebEthaEdit as an external editor.</strong></p>
<p>Open your <code>~/.gitconfig</code> file. This time, under the <code>[core]</code> section, add the following line:</p>
<div class="code"><span style="color:#dd0000;">[</span><span style="color:#003369;">core</span><span style="color:#dd0000;">]</span><br />
editor = /usr/bin/see -w -r -o new-window -j &#8216;git editor&#8217; -m gitCommit -g 1:0</div>
<p>All those flags may seem daunting, but they are quite self-explanatory: the <code>-w</code> flag makes the Terminal wait for a response from SubEthaEdit. <code>-r</code> brings Terminal to the front after you&#8217;re done editing. <code>-o new-window</code> opens a new window for editing. I prefer this to having a new tab appear in whatever window I was working on. <code>-j 'git editor</code>&#8216; this sets the text that appears in the title bar, which you can change as you wish. <code>-m gitCommit</code> is what sets the mode to be used for editing. and <code>-g 1:0</code> puts the caret at the beginning of the file.</p>
<p>Now, when git asks you to write a commit message, or pick commits when running <code>git rebase -i</code> a SubEthaEdit window will open as the commit message editor. Make whatever changes you need then save the file (⌘-s) and then close the window (⌘-w) for these changes to take effect.</p>
]]></content:encoded>
			<wfw:commentRss>http://abizern.org/2009/11/08/integrating-git-with-subethaedit-and-changes/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
