openlayers svn into git

Tim Abell · February 4, 2010

Initial clone:
<pre>git svn clone -T trunk/openlayers/ -t tags/openlayers/ -b branches/openlayers/ openlayers.git</pre>
“” is in the wrong place and gets pulled in by the git clone.

I should have used --no-follow-parent to avoid the docs-2.8 tag pulling in docs history but not going to re-clone now. If you are repeating this, try this instead:
<pre>git svn clone --no-follow-parent -T trunk/openlayers/ -t tags/openlayers/ -b branches/openlayers/ openlayers.git
Find the errant docs branches & eliminate:
<pre>cd openlayers.git
for x in `git for-each-ref --format="%(refname)" 'refs/remotes/tags/docs*'`; do git update-ref -d $x; done
# expunge old objects (I think this works)
<pre>git reflog expire --all
git gc --aggressive --prune
Then run: to create real git tags.

If you just want the result you can download a copy complete with svn metadata from

You will then be able to run
<pre>git svn fetch
to get updates from the openlayers svn server.

There is a published copy at, though it doesn’t have the svn metadata.

<hr />
I also tackled the docs folder:

The docs directory has no matching branch or tag directories, so the following is sufficient:
<pre>git svn clone -T trunk/doc openlayers-doc.git
git gc --aggressive --prune
You can download this from

<hr />
Anything else I come up with will end up at

Share: Tweet | LinkedIn
Suggest improvments: page source on github