<?xml version="1.0" encoding="UTF-8"?>
<posts type="array">
  <post>
    <body>When you install Git, the first thing you should be doing is setting up your user details.

&lt;code class="terminal"&gt;git config --global user.name "Your name"  
git config --global user.email "you@example.com"&lt;/code&gt;

Obviously change these values for your own information.</body>
    <created-at type="datetime">2009-11-26T20:18:46+10:00</created-at>
    <id type="integer">92</id>
    <project-id type="integer" nil="true"></project-id>
    <published type="boolean">true</published>
    <published-at type="datetime">2009-11-26T20:17:00+10:00</published-at>
    <title>The first thing to do with Git</title>
    <updated-at type="datetime">2009-11-26T20:20:55+10:00</updated-at>
    <url>the-first-thing-to-do-with-git</url>
  </post>
  <post>
    <body>You've probably heard a lot about how awesome Git is from all the _cool_ people who are already using it. If you want to be part of the trendy crowd but feel tied down by your old Subversion repositories have no fear; Migrating all of those SVN repos to Git could not be easier **and** you get to keep the entire commit history of your project.

The first step is to create a text file that lists all of the users that would appear in your SVN repository and shows what their names would be for Git. The format is 'svn-username = Real Name &lt;email address&gt;', like so:

&lt;code class="terminal"&gt;nathan-hoad = Nathan Hoad &amp;lt;nathan@example.com&amp;gt;  
john-smith = John Smith &amp;lt;john@example.com&amp;gt;  
jane-doe = Jane Doe &amp;lt;jane@example.com&amp;gt;&lt;/code&gt;

Save this file as authors.txt.

Now we are going to do the magic to convert the repository. We first create a directory and initialise it as a git-svn frankenstein repository (the `--no-metadata` flag tells git to ignore all the SVN junk except the actual commit log). Then we slot our authors file in there to remap our users. Last of all we fetch the code (which might take a while).

Here we go (obviously change the repository location to your own):

&lt;code class="terminal"&gt;mkdir my_project_svn  
cd my_project_svn  
git svn init http://svn.blah.com/blah/trunk/ --no-metadata  
git config svn.authorsfile ../authors.txt  
git svn fetch&lt;/code&gt;

You might want to do away with the git-svn hybrid stuff so lastly we do a `git clone` of the directory we just created.

&lt;code class="terminal"&gt;cd ..  
git clone my_project_svn my_project&lt;/code&gt;

Now you have a pure Git repository. Do a `git log` to check that all of your project history still exists. If you are happy with everything you can `rm -rf my_project_svn` because it's not needed any more.

You can repeat this process for any other SVN repos that you want to convert to Git.</body>
    <created-at type="datetime">2009-11-24T11:51:04+10:00</created-at>
    <id type="integer">91</id>
    <project-id type="integer" nil="true"></project-id>
    <published type="boolean">true</published>
    <published-at type="datetime">2009-11-24T12:57:00+10:00</published-at>
    <title>How to: Migrate your SVN repository to Git</title>
    <updated-at type="datetime">2010-01-12T09:09:06+10:00</updated-at>
    <url>how-to-migrate-your-svn-repository-to-git</url>
  </post>
  <post>
    <body>You probably won't need to do this often (if ever at all) but just in case, here is how to delete a tag from a remote Git repository.

If you have a tag named '12345' then you would just do this:

&lt;code class="terminal"&gt;$ git tag -d 12345  
$ git push origin :refs/tags/12345&lt;/code&gt;

That will remove '12345' from the remote repository.</body>
    <created-at type="datetime">2009-11-14T16:57:11+10:00</created-at>
    <id type="integer">90</id>
    <project-id type="integer" nil="true"></project-id>
    <published type="boolean">true</published>
    <published-at type="datetime">2009-11-14T16:56:00+10:00</published-at>
    <title>How to: Delete a remote Git tag</title>
    <updated-at type="datetime">2009-11-14T17:01:30+10:00</updated-at>
    <url>how-to-delete-a-remote-git-tag</url>
  </post>
  <post>
    <body>You are busy programming away in the middle of a task and suddenly something urgent comes up. If you are awesome enough to be a [Git](http://git-scm.com/) user then you needn't fret, just use `git stash`.

&lt;code class="terminal"&gt;$ git stash&lt;/code&gt;  
_(Note: untracked files are ignored by stash)_

The `stash` command in Git is kind of like a clipboard; you can stash away any changes in your current branch to work on something else for a while. You can change branches and perform other commits. When you are ready to continue working on those changes simply change back to the branch that the stash came from and run `git stash apply`.

&lt;code class="terminal"&gt;$ git stash apply&lt;/code&gt;

If you want to clean out your stash (multiple stashes can be stored) then run `git stash clear` but be careful not to clear out your stashes if you have any that you need to apply first :-P

Check out the [git-stash documentation](http://www.kernel.org/pub/software/scm/git/docs/git-stash.html) for more information.</body>
    <created-at type="datetime">2009-10-26T22:36:10+10:00</created-at>
    <id type="integer">89</id>
    <project-id type="integer" nil="true"></project-id>
    <published type="boolean">true</published>
    <published-at type="datetime">2009-10-26T22:43:00+10:00</published-at>
    <title>How to: Git stash</title>
    <updated-at type="datetime">2009-10-26T22:44:16+10:00</updated-at>
    <url>how-to-git-stash</url>
  </post>
  <post>
    <body>Here's the scenario: You're working in a feature branch that isn't quite ready for a full merge but you do have a few commits in there that you want to push to master (for a release or whatever reason). This is just one of possibly many situations where making use of Git's `cherry-pick` command might prove useful.

First, from within your feature branch, copy the first six or seven characters of the ID of the commit that you want to bring in:

![Selecting a commit hash](http://img.skitch.com/20091022-1p6iciquuppea92fj8marrfqnc.jpg):center

Now jump into the branch that you want to _insert_ the commit into (I'm using `master`):

    $ git checkout master
    
And then `cherry-pick` your commit:

&lt;code class="terminal"&gt;$ git cherry-pick c90fd66&lt;/code&gt;

Now if you do a `git log` you will see your cherry-picked commit at the top.

Be wary of cherry-picking a lot of commits out of order, the Git log will reflect the order in which you cherry-picked, not the chronological order of the original commits (The original commit date is preserved, however).

For more information check out [Git's documentation on cherry-picking](http://www.au.kernel.org/software/scm/git/docs/git-cherry-pick.html).</body>
    <created-at type="datetime">2009-10-23T09:28:51+10:00</created-at>
    <id type="integer">88</id>
    <project-id type="integer" nil="true"></project-id>
    <published type="boolean">true</published>
    <published-at type="datetime">2009-10-23T09:26:00+10:00</published-at>
    <title>How to: Cherry-pick changes with Git</title>
    <updated-at type="datetime">2009-10-23T09:30:44+10:00</updated-at>
    <url>how-to-cherry-pick-changes-with-git</url>
  </post>
  <post>
    <body>Git has a number of awesome features; Not least of all is the ability to amend the previous commit. If you ever find that you accidentally left something out of your last commit, be it a file or an extra change to a file that you just committed, don't worry. It can easily be fixed :-D

All you have to do is stage the extra changes like you would for a normal commit:

    $ git add .

And then just commit with the `--amend` argument.

    $ git commit --amend

If you don't specify a commit message with `-m` you will be prompted with the previous commit message as a default.

When you're done you can check `git log --stat` to see your amended commit with the extra changes. For more information, check out [Git's 'commit' documentation](http://www.kernel.org/pub/software/scm/git/docs/git-commit.html).

Hope that was helpful.</body>
    <created-at type="datetime">2009-10-13T14:34:13+10:00</created-at>
    <id type="integer">87</id>
    <project-id type="integer" nil="true"></project-id>
    <published type="boolean">true</published>
    <published-at type="datetime">2009-10-13T14:32:00+10:00</published-at>
    <title>Git: Amend your last commit</title>
    <updated-at type="datetime">2009-10-13T14:38:50+10:00</updated-at>
    <url>git-amend-your-last-commit</url>
  </post>
  <post>
    <body>Are you using [Capistrano](http://www.capify.org/index.php/Capistrano) and [Git](http://git-scm.com/) and want to easily deploy from Git tags? It couldn't be simpler ;-)

Using Git, [tag a new release](http://progit.org/book/ch2-6.html):

&lt;code class="terminal"&gt;$ git tag -a 09.10.02.01 -m "Tagging a release"&lt;/code&gt;

You can use `git tag` to list your tags:

&lt;code class="terminal"&gt;$ git tag  
09.10.01.01  
09.10.01.02  
09.10.02.01&lt;/code&gt;

Now make sure you push your tags to the central repository:

&lt;code class="terminal"&gt;$ git push origin --tags&lt;/code&gt;

Now in your Capsitrano deploy script:

    set :branch do
      default_tag = `git tag`.split("\n").last
      
      tag = Capistrano::CLI.ui.ask "Tag to deploy (make sure to push the tag first): [#{default_tag}] "
      tag = default_tag if tag.empty?
      tag
    end

This will, on deployment, ask you which tag you want to deploy from (defaulting to the most recent tag).</body>
    <created-at type="datetime">2009-10-02T22:36:56+10:00</created-at>
    <id type="integer">86</id>
    <project-id type="integer" nil="true"></project-id>
    <published type="boolean">true</published>
    <published-at type="datetime">2009-10-03T00:42:00+10:00</published-at>
    <title>Deploy from a Git tag with Capistrano</title>
    <updated-at type="datetime">2009-10-19T11:19:31+10:00</updated-at>
    <url>deploy-from-a-git-tag-with-capistrano</url>
  </post>
  <post>
    <body>Just a quick note to mention some previously unmentioned syntax for [Moredown](/projects/moredown). It was already possible to specify a width and height for Flash embeds, I had just neglected to say how :-P.

If you want to specify a width and height in a Flash movie (or Youtube video) then just include it as you would the title text of a Markdown image. 

For example:

&lt;code class="terminal"&gt;!&amp;#91;Flash movie](flash:movie.swf "400 300")&lt;/code&gt;

Would result in a Flash movie with a width of 400 pixels and a height of 300 pixels.</body>
    <created-at type="datetime">2009-09-20T23:16:25+10:00</created-at>
    <id type="integer">85</id>
    <project-id type="integer">11</project-id>
    <published type="boolean">true</published>
    <published-at type="datetime">2009-09-20T23:12:00+10:00</published-at>
    <title>Width and height of Flash content in Moredown</title>
    <updated-at type="datetime">2009-09-20T23:17:42+10:00</updated-at>
    <url>width-and-height-of-flash-content-in-moredown</url>
  </post>
  <post>
    <body>After adding generic Flash movie support to [Moredown](/projects/moredown) I recieved a comment on Twitter from [@simultech](http://twitter.com/simultech) suggesting that I use [SwfObject](http://code.google.com/p/swfobject/). At first I wasn't sure how to include SwfObject support because it appeared to mean adding a dependency on external Javascript as well as duplicating a small amount of existing functionality.

I decided that the best way to approach the idea was to replace the existing/duplicated functionality with something that would work with or without SwfObject Javascript. The duplicated concepts mainly dealt with replacing things like Youtube with preview images so I changed them to be handled somewhat automatically. The options `:replace_flash_with` and `:youtube_as_images` are no longer available as a result. Now, Flash movies should be visible if Flash is available and a fallback should display if Flash is not available.

If you are using SwfObject then you can tell Moredown about it like this:

    Moredown.new('![Some Flash movie](flash:/media/some-movie.swf)', 
                 :swfobject =&gt; { :src =&gt; 'path/to/swfobject.js', 
                                 :version =&gt; '10',
                                 :fallback =&gt; 'Flash is not available.' })

Moredown uses SwfObject's _static publishing_ method of embedding Flash content. For more information about it [have a look at their documentation](http://code.google.com/p/swfobject/wiki/documentation).</body>
    <created-at type="datetime">2009-09-11T09:29:13+10:00</created-at>
    <id type="integer">84</id>
    <project-id type="integer">11</project-id>
    <published type="boolean">true</published>
    <published-at type="datetime">2009-09-11T09:31:00+10:00</published-at>
    <title>Moredown: Now with SwfObject support!</title>
    <updated-at type="datetime">2009-09-11T09:35:03+10:00</updated-at>
    <url>moredown-now-with-swfobject-support</url>
  </post>
  <post>
    <body>[Moredown](/projects/moredown) now lets you embed Flash movies into your documents. 

Assuming you have a Flash file, _game.swf_, you can embed it like this:

&lt;code class="terminal"&gt;!&amp;#91;Flash](flash:game.swf)&lt;/code&gt;

That will generate something like this:

    &lt;object data="game.swf"
            type="application/x-shockwave-flash" 
            width="400" 
            height="300"&gt;
        &lt;param name="movie" value="game.swf" /&gt;
    &lt;/object&gt;</body>
    <created-at type="datetime">2009-09-05T18:38:59+10:00</created-at>
    <id type="integer">83</id>
    <project-id type="integer">11</project-id>
    <published type="boolean">true</published>
    <published-at type="datetime">2009-09-05T18:31:00+10:00</published-at>
    <title>Moredown: Flash movies</title>
    <updated-at type="datetime">2009-09-05T18:45:10+10:00</updated-at>
    <url>moredown-flash-movies</url>
  </post>
</posts>
