<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>subtleGradient comments on Cloning a Git SVN Clone</title>
    <link>http://subtlegradient.com/</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>subtleGradient comments</description>
    <item>
      <title>"Cloning a Git SVN Clone": comment by Thomas Aylott</title>
      <description>&lt;p&gt;&lt;a href="http://www.winksaville.com/blog/linux/scm-git-svn-connect/"&gt;Wink Saville&amp;#8217;s Blog&amp;#8212;scm &amp;#8211; git svn connect&lt;/a&gt; helped me figure out that quick trick about not having to fetch your subversion history from the beginning.&lt;/p&gt;</description>
      <pubDate>Tue, 22 Apr 2008 12:10:19 PDT</pubDate>
      <guid>http://subtlegradient.com/articles/2008/04/22/cloning-a-git-svn-clone#comment-543</guid>
      <link>http://subtlegradient.com/articles/2008/04/22/cloning-a-git-svn-clone#comment-543</link>
    </item>
    <item>
      <title>"Cloning a Git SVN Clone" by admin</title>
      <description>&lt;p&gt;I&amp;#8217;ve been trying to figure out a good way to make a publicly available &lt;code&gt;git-svn&lt;/code&gt; repo on &lt;a href="http://github.com/subtlegradient"&gt;GitHub.com&lt;/a&gt; that I can clone and then keep up to date with both the original svn repo and the GitHub repo and commit everything into my own fork.&lt;/p&gt;


	&lt;p&gt;So, how do you go about creating a Git repo that can push and pull to and from both Git and Subversion?&lt;/p&gt;

&lt;h3&gt;Clone the public repo&lt;/h3&gt;


&lt;pre&gt;
git clone git://github.com/drnic/ruby-tmbundle.git Ruby.tmbundle
cd Ruby.tmbundle/
&lt;/pre&gt;

	&lt;h3&gt;Fork the repo. &lt;em&gt;optional&lt;/em&gt;&lt;/h3&gt;


&lt;pre&gt;
git checkout master
git remote rm origin
git remote add origin git@github.com:subtleGradient/ruby-tmbundle.git
git pull
&lt;/pre&gt;

	&lt;h3&gt;Set your subversion remote&lt;/h3&gt;


	&lt;p&gt;Run this to set your subversion remote and pickup all your existing history asif you&amp;#8217;d done a &lt;code&gt;git svn clone ...&lt;/code&gt;.&lt;/p&gt;


&lt;pre&gt;
git branch macromates
git checkout macromates

git svn init http://macromates.com/svn/Bundles/trunk/Bundles/Ruby.tmbundle -R svn
cp .git/refs/remotes/origin/master .git/refs/remotes/git-svn
git svn fetch
&lt;/pre&gt;

	&lt;h4&gt;This should give you&amp;#8230;&lt;/h4&gt;


&lt;pre class="result"&gt;...
r9048 = a0bdcedd42f7ed1867d32120bbf92bab7b72f085
r9051 = 4eb5fee1621549f676f9d5e085f1ccf03489e334
r9362 = 28b1ea1529b071fa10ba458e816e4a9454f85d8a
Done rebuilding .git/svn/git-svn/.rev_map.dfb7d73b-c2ec-0310-8fea-fb051d288c6d
&lt;/pre&gt;

	&lt;h4&gt;If you get this error&amp;#8230;&lt;/h4&gt;


&lt;pre class="error-result"&gt;
Remote ref refs/remote/git-svn is tracked by
  "svn-remote.svn.fetch=:refs/remotes/git-svn" 
and
  "svn-remote.svn.fetch=:refs/remotes/git-svn" 
Please resolve this ambiguity in your git configuration file before continuing
&lt;/pre&gt;

	&lt;p&gt;... then you probably ran &lt;code&gt;git svn init&lt;/code&gt; twice without passing in a new name for each one. You&amp;#8217;ll have to remove the extra &lt;code&gt;fetch = :refs/remotes/git-svn&lt;/code&gt; reference if your &lt;code&gt;.git/config&lt;/code&gt; file.&lt;/p&gt;


	&lt;h3&gt;Keeping up-to-date&lt;/h3&gt;


	&lt;p&gt;Fetch from your public subversion repo&amp;#8230;&lt;/p&gt;


&lt;pre&gt;
git checkout macromates
git svn fetch svn
&lt;/pre&gt;

	&lt;p&gt;Pull from your public Git origin&amp;#8230;&lt;/p&gt;


&lt;pre&gt;
git checkout master
git pull origin master:master
&lt;/pre&gt;

	&lt;p&gt;Now you have two branches in the same Git repo that pull from a separate &lt;span class="caps"&gt;SCM&lt;/span&gt;.&lt;/p&gt;


	&lt;p&gt;&lt;em&gt;&lt;strong&gt;Congrats&lt;/strong&gt;, you so totally rock!&lt;/em&gt;&lt;/p&gt;


	&lt;h3&gt;Back to &lt;code&gt;master&lt;/code&gt;&lt;/h3&gt;


	&lt;p&gt;Once you&amp;#8217;re done setting up and fetching changes from subversion, you should switch back to your &lt;code&gt;master&lt;/code&gt; branch.&lt;/p&gt;


&lt;pre&gt;git checkout master&lt;/pre&gt;

	&lt;h3&gt;That&amp;#8217;s it!&lt;/h3&gt;


	&lt;p&gt;&lt;em&gt;Next time&amp;#8230;&lt;/em&gt; fetching, merging and pushing back!&lt;/p&gt;</description>
      <pubDate>Tue, 22 Apr 2008 10:03:00 PDT</pubDate>
      <guid>&lt;a href="/articles/2008/04/22/cloning-a-git-svn-clone"&gt;Cloning a Git SVN Clone&lt;/a&gt;</guid>
      <link>&lt;a href="/articles/2008/04/22/cloning-a-git-svn-clone"&gt;Cloning a Git SVN Clone&lt;/a&gt;</link>
    </item>
  </channel>
</rss>
