<?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>Stereo Interactive &#38; Design - Ann Arbor, Michigan Web Design &#187; git</title>
	<atom:link href="http://stereointeractive.com/blog/tag/git/feed/" rel="self" type="application/rss+xml" />
	<link>http://stereointeractive.com/blog</link>
	<description>Development Blog</description>
	<lastBuildDate>Tue, 20 Mar 2012 08:00:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Import SVN project into Git</title>
		<link>http://stereointeractive.com/blog/2012/03/20/import-svn-project-into-git/</link>
		<comments>http://stereointeractive.com/blog/2012/03/20/import-svn-project-into-git/#comments</comments>
		<pubDate>Tue, 20 Mar 2012 06:57:03 +0000</pubDate>
		<dc:creator>Scott Meves</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[SVN]]></category>

		<guid isPermaLink="false">http://stereointeractive.com/blog/?p=619</guid>
		<description><![CDATA[Recently we converted a few SVN projects to Git. We used a method that converts svn authors to git authors and then uploads the repository to github. It also maintains tags and branches. Here is how we did it: echo &#34;svnuser &#60;mygithubemail@example.com&#62;&#34; &#62; authors mkdir myproject-git cd myproject-git git svn init -t tags -b branches [...]]]></description>
			<content:encoded><![CDATA[<p>Recently we converted a few SVN projects to Git. We used a method that converts svn authors to git authors and then uploads the repository to github. It also maintains tags and branches. Here is how we did it:<br />
<span id="more-619"></span></p>

<div class="wp_syntax"><div class="code"><pre class="shell">echo &quot;svnuser &lt;mygithubemail@example.com&gt;&quot; &gt; authors
mkdir myproject-git
cd myproject-git
git svn init -t tags -b branches -T trunk svn+ssh://svnuser@mysvnhost/path/to/svn/repo
git svn fetch --authors-file=../authors
git for-each-ref refs/remotes/tags --shell --format=&quot;r=%(refname:short) t=\${r#tags/}&quot; | while read e; do eval &quot;$e&quot;; git tag -f $t refs/remotes/$r; git branch -d -r $r; done
git remote add origin git@github.com:gituser/mygitrepo.git
git push -u origin master
git push --tags</pre></div></div>

<p>The git for-each-ref script was taken from <a href="http://gitready.com/advanced/2009/02/16/convert-git-svn-tag-branches-to-real-tags.html">gitready.com</a> and converts the tag branches into actual git tags and then delete those branches from the new git repository.</p>
<p>SVN externals will not be imported. In that event, you may find a git mirror of the svn repositories and you can set them up as submodules:</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span class="kw2">git</span> submodule add <span class="kw2">git</span>:<span class="sy0">//</span>github.com<span class="sy0">/</span>path<span class="sy0">/</span>an-old-svn-external.git vendor<span class="sy0">/</span>my-new-submodule
<span class="kw3">cd</span> vendor<span class="sy0">/</span>my-new-submodule
<span class="kw2">git</span> checkout v1.0
<span class="kw3">cd</span> ..
<span class="kw2">git</span> add my-new-submodule
<span class="kw2">git</span> commit <span class="re5">-m</span> <span class="st0">&quot;adding submodule at v1.0&quot;</span>
<span class="kw2">git</span> push</pre></div></div>

<p>sources: <a href="http://stackoverflow.com/questions/1777854/git-submodules-specify-a-branch-tag">http://stackoverflow.com/questions/1777854/git-submodules-specify-a-branch-tag</a></p>
<p>If you need to find a specific svn revision number so you can tie your git submodule to the same revision, this will parse all of the git log messages (which will contain the svn revision number of it was imported from an svn repository) and display the revision numbers for you:</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span class="kw2">git</span> log <span class="re5">-z</span> <span class="sy0">|</span> <span class="kw2">tr</span> <span class="st_h">'\n\0'</span> <span class="st_h">' \n'</span> <span class="sy0">|</span> <span class="kw2">sed</span> <span class="st_h">'s/\(commit \S*\) .*git-svn-id: svn:[^@]*@\([0-9]*\) .*/\1 r\2/'</span></pre></div></div>

<p>source: <a href="http://stackoverflow.com/a/2872369/149503">http://stackoverflow.com/a/2872369/149503</a></p>
]]></content:encoded>
			<wfw:commentRss>http://stereointeractive.com/blog/2012/03/20/import-svn-project-into-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git Basics</title>
		<link>http://stereointeractive.com/blog/2010/07/06/git-basics/</link>
		<comments>http://stereointeractive.com/blog/2010/07/06/git-basics/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 20:27:19 +0000</pubDate>
		<dc:creator>Scott Meves</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://stereointeractive.com/blog/?p=525</guid>
		<description><![CDATA[A cheat-sheet to reference while getting started with git. 1. Pull down a copy of the repository: git clone &#60;repository&#62; 2. List available branches (on the remote server) git branch -r 3. Create a new branch git branch &#60;branchname&#62; 4. Switch to an existing branch git checkout &#60;branchname&#62; 5. After you have made changes to [...]]]></description>
			<content:encoded><![CDATA[<p>A cheat-sheet to reference while getting started with git.</p>
<p>1. Pull down a copy of the repository:<span id="more-525"></span></p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span class="kw2">git</span> clone <span class="sy0">&lt;</span>repository<span class="sy0">&gt;</span></pre></div></div>

<p>2. List available branches (on the remote server)</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span class="kw2">git</span> branch <span class="re5">-r</span></pre></div></div>

<p>3. Create a new branch</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span class="kw2">git</span> branch <span class="sy0">&lt;</span>branchname<span class="sy0">&gt;</span></pre></div></div>

<p>4. Switch to an existing branch</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span class="kw2">git</span> checkout <span class="sy0">&lt;</span>branchname<span class="sy0">&gt;</span></pre></div></div>

<p>5. After you have made changes to your local files, you can review what has changed with:</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span class="kw2">git</span> status</pre></div></div>

<p>6. If you want to add a few of those changes files in your next commit:</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span class="kw2">git</span> add <span class="sy0">&lt;</span><span class="kw2">file</span><span class="sy0">&gt;</span></pre></div></div>

<p>7. Commit those changes files to your local &#8216;stage&#8217; (doesn&#8217;t push them back up to the remote server)</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span class="kw2">git</span> commit <span class="re5">-m</span> <span class="st0">&quot;Your message here.&quot;</span></pre></div></div>

<p>8. Push your committed changes to the remote repository:</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span class="kw2">git</span> push origin <span class="sy0">&lt;</span>branch<span class="sy0">&gt;</span></pre></div></div>

<p>9. Tag a snapshot of the code:</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span class="kw2">git</span> tag <span class="re5">-a</span> <span class="sy0">&lt;</span>v1.2<span class="sy0">&gt;</span> <span class="re5">-m</span> <span class="st0">&quot;Tagging 1.2 with fixes for x,y,z&quot;</span></pre></div></div>

<p>10. merge changes from a branch to back to master</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span class="kw2">git</span> checkout master
<span class="kw2">git</span> merge dev</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://stereointeractive.com/blog/2010/07/06/git-basics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

