<?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>Shaun Smith &#187; git</title>
	<atom:link href="http://shaun.boyblack.co.za/blog/tag/git/feed/" rel="self" type="application/rss+xml" />
	<link>http://shaun.boyblack.co.za/blog</link>
	<description>Flex, Ruby, Mongo - London, UK</description>
	<lastBuildDate>Sat, 04 Feb 2012 17:39:55 +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>Commit Messages</title>
		<link>http://shaun.boyblack.co.za/blog/2011/11/09/commit-messages/</link>
		<comments>http://shaun.boyblack.co.za/blog/2011/11/09/commit-messages/#comments</comments>
		<pubDate>Wed, 09 Nov 2011 18:29:56 +0000</pubDate>
		<dc:creator>shaun</dc:creator>
				<category><![CDATA[Banter]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://shaun.boyblack.co.za/blog/?p=1009</guid>
		<description><![CDATA[When reviewing a commit I&#8217;m not interested in what you did. A commit is a codebase transformation. I&#8217;m interested in what will happen to my codebase when I apply your commit. Bad &#8220;I did this&#8221; form: I had a cup of coffee, went for a walk, and changed some code. &#160; Better &#8220;This commit does this&#8221; form: Adds unmap() to the command map API. A commit message should describe the commit, not the process you went through to create it &#8230; <a href="http://shaun.boyblack.co.za/blog/2011/11/09/commit-messages/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When reviewing a commit I&#8217;m not interested in what you did. A commit is a codebase transformation. I&#8217;m interested in what will happen to my codebase when I apply your commit.</p>
<h4>Bad &#8220;I did this&#8221; form:</h4>
<pre>I had a cup of coffee, went for a walk, and changed some code.</pre>
<p>&nbsp;</p>
<h4>Better &#8220;This commit does this&#8221; form:</h4>
<pre>Adds unmap() to the command map API.</pre>
<p>A commit message should describe the commit, not the process you went through to create it &#8211; it is not a diary.</p>
]]></content:encoded>
			<wfw:commentRss>http://shaun.boyblack.co.za/blog/2011/11/09/commit-messages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linking to your GitHub code</title>
		<link>http://shaun.boyblack.co.za/blog/2010/08/19/linking-to-your-github-code/</link>
		<comments>http://shaun.boyblack.co.za/blog/2010/08/19/linking-to-your-github-code/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 22:33:17 +0000</pubDate>
		<dc:creator>shaun</dc:creator>
				<category><![CDATA[Banter]]></category>
		<category><![CDATA[Robotlegs]]></category>
		<category><![CDATA[crybaby]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>

		<guid isPermaLink="false">http://shaun.boyblack.co.za/blog/?p=931</guid>
		<description><![CDATA[It&#8217;s pretty easy to link directly to a line of code in your GitHub repo: robotlegs/robotlegs-framework/blob/master/src/org/robotlegs/core/IContextProvider.as#L16 Don&#8217;t do that you naughty sausage! Your codebase will evolve (if all goes well), and line 16 will be replaced by a newer, shinier string of characters. Or, in this case, it&#8217;ll point to something that no longer exists. This, on the other hand, is more likely to stick around to haunt its author (me): robotlegs/robotlegs-framework/blob/v1.1.2/src/org/robotlegs/core/IContextProvider.as#L16 Select a tag before you link to your &#8230; <a href="http://shaun.boyblack.co.za/blog/2010/08/19/linking-to-your-github-code/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s pretty easy to link directly to a line of code in your <a title="GitHub" href="http://github.com/">GitHub</a> repo:</p>
<p><a href="http://github.com/robotlegs/robotlegs-framework/blob/master/src/org/robotlegs/core/IContextProvider.as#L16">robotlegs/robotlegs-framework/blob/<strong>master</strong>/src/org/robotlegs/core/IContextProvider.as#L16</a></p>
<p><strong>Don&#8217;t do that you naughty sausage!</strong> Your codebase will evolve (if all goes well), and line 16 will be replaced by a newer, shinier string of characters. Or, in this case, it&#8217;ll point to something that no longer exists.</p>
<p>This, on the other hand, is more likely to stick around to haunt its author (me):</p>
<p><a href="http://github.com/robotlegs/robotlegs-framework/blob/v1.1.2/src/org/robotlegs/core/IContextProvider.as#L16">robotlegs/robotlegs-framework/blob/<strong>v1.1.2</strong>/src/org/robotlegs/core/IContextProvider.as#L16</a></p>
<p>Select a tag before you link to your fancy code (&#8220;Switch Tags&#8221; under <a title="GitHub" href="http://github.com/">GitHub</a>&#8216;s &#8220;Source&#8221; menu).</p>
<p><img class="alignnone size-full wp-image-941" title="GitHub_Tags_435" src="http://shaun.boyblack.co.za/blog/wp-content/uploads/2010/08/GitHub_Tags_435.png" alt="" width="435" height="250" /></p>
]]></content:encoded>
			<wfw:commentRss>http://shaun.boyblack.co.za/blog/2010/08/19/linking-to-your-github-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OS X Git Prompt</title>
		<link>http://shaun.boyblack.co.za/blog/2009/11/15/os-x-git-prompt/</link>
		<comments>http://shaun.boyblack.co.za/blog/2009/11/15/os-x-git-prompt/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 01:26:37 +0000</pubDate>
		<dc:creator>shaun</dc:creator>
				<category><![CDATA[Resources]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[prompt]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://shaun.boyblack.co.za/blog/?p=879</guid>
		<description><![CDATA[I&#8217;m currently using a modified version of git-prompt that looks something like this: If you want to try it out, you can download this zip-ball: git-prompt.zip Unpack that into your User folder, and add this to your bash .profile: # Git Prompt - Modified from: http://volnitsky.com/project/git-prompt/ [[ $- == *i* ]] &#38;&#38; . ~/git-prompt/git-prompt.sh Tip: You can open your .profile from your terminal like so: open ~/.profile Note: You will need to start a new shell session after editing that &#8230; <a href="http://shaun.boyblack.co.za/blog/2009/11/15/os-x-git-prompt/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently using a modified version of <a title="Git-prompt" href="http://volnitsky.com/project/git-prompt/">git-prompt</a> that looks something like this:</p>
<p><img class="alignnone size-full wp-image-885" title="Git-prompt" src="http://shaun.boyblack.co.za/blog/wp-content/uploads/2009/11/Git-prompt1.png" alt="Git-prompt" width="499" height="558" /><br />
<span id="more-879"></span></p>
<p>If you want to try it out, you can download this zip-ball:</p>
<p><a href="http://shaun.boyblack.co.za/blog/wp-content/uploads/2009/11/git-prompt.zip">git-prompt.zip</a></p>
<p>Unpack that into your User folder, and add this to your bash .profile:</p>
<pre># Git Prompt - Modified from: http://volnitsky.com/project/git-prompt/
[[ $- == *i* ]] &amp;&amp; . ~/git-prompt/git-prompt.sh</pre>
<p>Tip: You can open your .profile from your terminal like so:</p>
<pre>open ~/.profile</pre>
<p>Note: You will need to start a new shell session after editing that file in order to see the changes.</p>
<p>I use Nano as my default bash text editor. If you want that, add this to your .profile:</p>
<pre># Use the nano text editor
export EDITOR="nano"</pre>
<p>And for the Terminal.app style:</p>
<p><img class="alignnone size-full wp-image-883" title="Terminal-prefs" src="http://shaun.boyblack.co.za/blog/wp-content/uploads/2009/11/Terminal-prefs.png" alt="Terminal-prefs" width="500" height="386" /></p>
<p><a href="http://shaun.boyblack.co.za/blog/wp-content/uploads/2009/11/Power-User-Pro.terminal.zip">Power-User-Pro.terminal.zip</a></p>
<p>The shell commands (copy-paste):</p>
<pre>mkdir Test
cd Test/
git init
touch somefile
git add somefile
git commit -m "commit message"
echo "hi" &gt; somefile
git add somefile
git commit -m "second commit"
git checkout -b temp
echo "hello" &gt; somefile
git add .
git commit -m "3rd commit"</pre>
]]></content:encoded>
			<wfw:commentRss>http://shaun.boyblack.co.za/blog/2009/11/15/os-x-git-prompt/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Getting Started with Git on Mac OS X</title>
		<link>http://shaun.boyblack.co.za/blog/2009/03/14/getting-started-with-git-on-mac-os-x/</link>
		<comments>http://shaun.boyblack.co.za/blog/2009/03/14/getting-started-with-git-on-mac-os-x/#comments</comments>
		<pubDate>Sat, 14 Mar 2009 18:42:32 +0000</pubDate>
		<dc:creator>shaun</dc:creator>
				<category><![CDATA[Resources]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[scm]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://shaun.boyblack.co.za/blog/?p=224</guid>
		<description><![CDATA[Some Background I&#8217;ve recently switched from using SVN to using Git as my source control management tool of choice. It took a little while to get to grips with, but it rocks! Git is not an evolution of SVN. It is entirely different. Git is a distributed revision control system &#8211; everybody working on a project has their own full copy of the repository and its entire history. Git does not require the presence of a network connection: most commands &#8230; <a href="http://shaun.boyblack.co.za/blog/2009/03/14/getting-started-with-git-on-mac-os-x/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>Some Background</strong></p>
<p>I&#8217;ve recently switched from using SVN to using <a title="Git SCM" href="http://git-scm.com/" target="_blank">Git</a> as my source control management tool of choice. It took a little while to get to grips with, but it rocks!</p>
<p>Git is not an evolution of SVN. It is entirely different. Git is a distributed revision control system &#8211; everybody working on a project has their own full copy of the repository and its entire history.<span id="more-224"></span></p>
<p>Git does not require the presence of a network connection: most commands in Git operate locally, allowing you to review your project history, make branches and tags, merge changes, but most importantly, allowing you to commit while offline.</p>
<p>If you&#8217;ve used SVN you&#8217;ve probably noticed the littering of .svn folders across your entire project tree, requiring the need for an export tool to retrieve clean copies of your code, and introducing problems when you delete, rename or move files or folders in your project. Git takes a slightly more sensible approach: it creates one folder (named .git) in the root folder of your project.<strong></strong></p>
<p><strong>Git Concepts</strong></p>
<p>With Git there are 3 important things to be aware of: the Git object database, the &#8220;index&#8221;, and your working area.</p>
<p>The Git object database contains a bunch of stuff that you typically don&#8217;t need to worry about. Essentially it&#8217;s the repository.</p>
<p>Your working area is the collection of files currently sitting in your project folder. You should treat these files as if they are temporary &#8211; because they are! Things you want to keep should be committed to the repository.</p>
<p>The Index is sometimes referred to as the Staging Area. It&#8217;s a list of what will get stored on your next commit. Conceptually it sits between your working files and the Git object database. Files that haven&#8217;t been staged to the index will be ignored when doing a commit. This gives you great control over what gets committed when.</p>
<p>A branch is a cheap copy of a particular state of the Git object database. Branches are easy to create and switch between, giving you a safe way to try out ideas quickly and easily. Switching to another branch updates your working area to reflect the state of that branch &#8211; this is why you should consider your working area temporary.</p>
<p><strong>Installing Git on Mac OS X</strong></p>
<p>Grab and install the latest OS-X Installer from:</p>
<p><a title="Git OSX Installer" href="http://code.google.com/p/git-osx-installer/" target="_blank">http://code.google.com/p/git-osx-installer/</a></p>
<p><strong>Configuring Git</strong></p>
<p>You need to tell Git who you are &#8211; it uses this information for your commits etc.</p>
<p>Fire up your terminal, and type:</p>
<pre>git config --global user.name "Your Name"
git config --global user.email your@email.com</pre>
<p><strong>Using Git</strong></p>
<p>Once Git is installed on your system, creating a Git repository is easy: open your terminal, cd into the root folder of your project, and type: git init</p>
<p>That&#8217;s pretty much it!</p>
<p>After initialising your Git repository, it will most likely be empty. In order to commit files to the repository you first need to &#8220;stage&#8221; them by adding them to the index. To add all the files in your current project to the index type:</p>
<pre>git add .</pre>
<p>To commit these files type:</p>
<pre>git commit -m "your commit message"</pre>
<p>To view the status of your repository type:</p>
<pre>git status</pre>
<p><strong>To Summarise</strong></p>
<p>[<a title="Git OSX Installer" href="http://code.google.com/p/git-osx-installer/" target="_blank">Download and install Git</a>]<br />
[cd into the root of your project]</p>
<pre>
git init
ls -la
git status
git add .
git status
git commit -m "a useful commit message"
git status
</pre>
<p>[change some files in your working area]</p>
<pre>
git status
git diff
git commit -a -m "commit message. -a adds all files from your working area to the index"
git status
</pre>
<p>[delete some files from your local working area]</p>
<pre>
git status
git add -u
git commit -m "commit message. -u adds deleted files to the index"
git status
</pre>
<p><strong>Ignoring Files</strong></p>
<p>You will probably want to ensure than certain files don&#8217;t ever get committed to the repo:</p>
<p><a title="Git Ignore" href="http://www.kernel.org/pub/software/scm/git/docs/gitignore.html" target="_blank">http://www.kernel.org/pub/software/scm/git/docs/gitignore.html</a></p>
<p><strong>Extra Configuration</strong></p>
<p>You can enabled colorful output:</p>
<pre>
git config --global color.diff auto
git config --global color.status auto
git config --global color.branch auto
</pre>
<p><strong>Some Bundled Visual Tools</strong></p>
<pre>
gitk
git gui
</pre>
<p><strong>Git Screencasts</strong></p>
<p><a title="Git Screencasts" href="http://gitcasts.com/" target="_blank">http://gitcasts.com/</a></p>
<p><strong>Installing Git on Windows</strong></p>
<p><a title="Installing Git on Windows" href="http://gitcasts.com/posts/git-on-windows" target="_blank">http://gitcasts.com/posts/git-on-windows</a></p>
<p><strong>Some Other Git Links</strong></p>
<ul>
<li><a title="Git Source Control Management" href="http://git-scm.com/" target="_blank">http://git-scm.com/</a></li>
<li><a title="Understanding Git Conceptually" href="http://www.eecs.harvard.edu/~cduan/technical/git/" target="_blank">http://www.eecs.harvard.edu/~cduan/technical/git/</a></li>
<li> <a href="http://git.or.cz/index.html" target="_blank">http://git.or.cz/index.html</a></li>
<li><a href="http://git.or.cz/course/svn.html" target="_blank">http://git.or.cz/course/svn.html</a></li>
<li><a title="Git FAQ" href="http://git.or.cz/gitwiki/GitFaq" target="_blank">http://git.or.cz/gitwiki/GitFaq</a></li>
<li><a title="Github Learning Resource" href="http://learn.github.com/" target="_blank">http://learn.github.com/</a></li>
<li><a title="Git OSX Installer" href="http://code.google.com/p/git-osx-installer/" target="_blank">http://code.google.com/p/git-osx-installer/</a></li>
<li><a title="Git User Manual" href="http://www.kernel.org/pub/software/scm/git/docs/user-manual.html" target="_blank">http://www.kernel.org/pub/software/scm/git/docs/user-manual.html</a></li>
<li><a title="The Thing About Git" href="http://tomayko.com/writings/the-thing-about-git" target="_blank">http://tomayko.com/writings/the-thing-about-git</a></li>
<li><a title="Git Talk" href="http://video.google.com/videoplay?docid=-3999952944619245780" target="_blank">http://video.google.com/videoplay?docid=-3999952944619245780</a></li>
</ul>
<p><strong>Eclipse Integration</strong></p>
<p>Point your eclipse update manager to: <a title="EGit" href="http://www.jgit.org/update-site" target="_blank">http://www.jgit.org/update-site</a></p>
<p>More info: <a title="JGit" href="http://www.jgit.org/" target="_blank">http://www.jgit.org/</a></p>
<p><strong>Some Commands</strong></p>
<p><em>Add all working files to the index:</em></p>
<pre>git add .</pre>
<p><em>Add deleted files to the index:</em></p>
<pre>git add -u</pre>
<p><em>Create and switch to a new branch:</em></p>
<pre>git checkout -b newbranchname</pre>
<p><em>Review last commit:</em></p>
<pre>
git show
git show --stat
git show --name -status
git show HEAD
</pre>
<p><em>Review commit history:</em></p>
<pre>
git log
git log tag..branch
git log -10
git log --since="May 1" --until="June 1"
git log --author=fred
git log -- some/file
</pre>
<p><em>Creating branches:</em></p>
<pre>
git branch name
git branch name commit
</pre>
<p><em>Switching branches:</em></p>
<pre>
git checkout name
git checkout -f name
</pre>
]]></content:encoded>
			<wfw:commentRss>http://shaun.boyblack.co.za/blog/2009/03/14/getting-started-with-git-on-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
	</channel>
</rss>

