On Tue, 22 Jan 2013 02:11:00 -0800 (PST)
Luís de Sousa <luis.a.de.so...@gmail.com> wrote:

> Dear all,
> I have a basic SVN repo with a few tags marking code releases
> organised the following way:
> /src
> /releases
>    /0.1
>    /0.2
>    /0.3
>    ....
> Where *src* is the trunk and all sub-folders of *releases* are tags
> created with *svn copy*. I've managed to migrate this repo using *git
> svn*, but the tags are not recognised as tags nor branches, git svn
> simply replicates the folder structure. I hape tried *svn2git*, but
> it doesn work on my system[1]. I've also tried some tutorials[2], but
> these don't seem to apply to my particular repo structure.

Since Subversion does not really have tags, only named versioned
folders, there's no one-to-one mapping from Subversion tags to Git's.
Hence git-svn creates one remote branch in your local repository for
each "tag" in the Subversion repository.

If you're certain about converting the fetched history to Git (so that
you will be using Git only and won't commit to that Subversion repo),
then you have to create a real Git tag in your repo for each remote
branch related to a tag in the source Subversion repo.
This is best done with `git for-each-ref` and a bit of shell scripting.
Something like this:

$ git for-each-ref 'refs/remotes/releases/*' | while read sha _ ref; \
  do git tag ${ref##*/} $sha && git branch -d "$ref"; done

This would create tags named "0.1", "0.2" etc out of those remote

Of course, investigate your particular case first (like at least run
`git branch -r` to verify you do really have branches named after
"release/1.0" there etc.


Reply via email to