<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Pragmatic Forums | Posts in topic 'can you use git-svn to clone only a branch in SVN?'</title>
    <link>/forums/139/topics/7045.rss</link>
    <language>en-us</language>
    <ttl>60</ttl>
    <item>
      <title>can you use git-svn to clone only a branch in SVN? posted by Travis Swicegood @ Mon, 20 Sep 2010 17:43:15 +0000</title>
      <description>&lt;p&gt;Hey Barrett;&lt;/p&gt;


	&lt;p&gt;Yes, you could definitely do that.  If you want to clone only that branch, use that as your &lt;span class="caps"&gt;SVN&lt;/span&gt; repo &lt;span class="caps"&gt;URL&lt;/span&gt; and don&amp;#8217;t add the &lt;code&gt;-s&lt;/code&gt; parameter to specify the standard layout.  That tells &lt;code&gt;git-svn&lt;/code&gt; to treat that branch&amp;#8217;s &lt;span class="caps"&gt;URL&lt;/span&gt; as if it&amp;#8217;s your entire history.&lt;/p&gt;


	&lt;p&gt;On the other hand, if you want to have the entire repository and be able to commit to a particular branch inside &lt;span class="caps"&gt;SVN&lt;/span&gt;, you can do that by creating a new local branch and then running &lt;code&gt;git svn dcommit&lt;/code&gt; within that.  Consider this repository layout:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;branches/development
trunk/
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Assuming this has been cloned using &lt;code&gt;git svn clone -s ... svn url ...&lt;/code&gt;, we now have &lt;code&gt;development&lt;/code&gt; and &lt;code&gt;trunk&lt;/code&gt; remote branches.  To work in the &lt;code&gt;development&lt;/code&gt; branch, you need only:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;prompt&amp;gt; git checkout -b development remotes/development
... make some changes, commit them ...
prompt&amp;gt; git svn dcommit
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;That sends the changes back upstream to the &lt;span class="caps"&gt;SVN&lt;/span&gt; repository in the development branch.  You can switch back over to &lt;code&gt;master&lt;/code&gt; for changes you want to send to &lt;code&gt;trunk&lt;/code&gt;.&lt;/p&gt;


	&lt;p&gt;Hope that helps.  Let me know if there&amp;#8217;s anything else I can help out with.&lt;br /&gt;-T&lt;/p&gt;</description>
      <pubDate>Mon, 20 Sep 2010 17:43:15 +0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:139:7045:19894</guid>
      <author>Travis Swicegood</author>
      <link>http://forums.pragprog.com/forums/139/topics/7045</link>
    </item>
    <item>
      <title>can you use git-svn to clone only a branch in SVN? posted by Barrett Kern @ Fri, 17 Sep 2010 21:59:18 +0000</title>
      <description>&lt;p&gt;I have a rather large repository and after finishing chapter ten I was unclear if I could only clone a branch in &lt;span class="caps"&gt;SVN&lt;/span&gt;. I would like to be able to push change back to this branch as well.&lt;/p&gt;


	&lt;p&gt;Thanks,&lt;br /&gt;Barry&lt;/p&gt;</description>
      <pubDate>Fri, 17 Sep 2010 21:59:18 +0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:139:7045:19849</guid>
      <author>Barrett Kern</author>
      <link>http://forums.pragprog.com/forums/139/topics/7045</link>
    </item>
  </channel>
</rss>
