<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -61,6 +61,17 @@ command :track do |remote, user|
   end
 end
 
+desc &quot;Fetch from a remote to a local branch.&quot;
+command :fetch do |user, branch|
+  die &quot;Specify a user to pull from&quot; if user.nil?
+  user, branch = user.split(&quot;/&quot;, 2) if branch.nil?
+  branch ||= 'master'
+  GitHub.invoke(:track, user) unless helper.tracking?(user)
+  
+  git &quot;fetch #{user} #{branch}:refs/remotes/#{user}/#{branch}&quot;
+  git_exec &quot;checkout -b #{user}/#{branch} refs/remotes/#{user}/#{branch}&quot;
+end
+
 desc &quot;Pull from a remote.&quot;
 flags :merge =&gt; &quot;Automatically merge remote's changes into your master.&quot;
 command :pull do |user, branch|</diff>
      <filename>commands/commands.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>fe1f852f3cf719c7cd86147031732f570ad89619</id>
    </parent>
  </parents>
  <author>
    <name>Tom Preston-Werner</name>
    <email>tom@mojombo.com</email>
  </author>
  <url>http://github.com/mojombo/github-gem/commit/dc053418ebce19d0b2d87bf25f87990dafb09e99</url>
  <id>dc053418ebce19d0b2d87bf25f87990dafb09e99</id>
  <committed-date>2008-09-30T15:26:34-07:00</committed-date>
  <authored-date>2008-09-30T15:26:34-07:00</authored-date>
  <message>Add `github fetch &lt;user&gt; &lt;branch&gt;` command.

This will create a remote for &lt;user&gt;, fetch the branch into refs/remotes/&lt;user&gt;/&lt;branch&gt; and then create a local branch from that. This is good for getting an exact copy of the branch (without merging it into another branch) for local testing or inspection.</message>
  <tree>6eb418cd775e7568a9fdf7550b36cb7cba893a65</tree>
  <committer>
    <name>Tom Preston-Werner</name>
    <email>tom@mojombo.com</email>
  </committer>
</commit>
