threads / discuss / 50260

How to convert SVN tags to git tags?

Subject: How to convert SVN tags to git tags?

## tl;dr

2 messages between Jan 18, 2019 and Jan 18, 2019.

replies: 1people: 2as markdown or json

Steve Keller· Jan 18, 2019, 12:50 UTC · lore

After converting from SVN to git using git svn init + git svn fetch, my SVN tags appear as remote branches in git. I find many suggestions to convert these to git tags by calling git tag -a <tag-name> <branch-name> but this gives something like this

               C4
               |
               V
    T -> C3 -> C2
               |
               V
               C1

that is, I still have a branch with only 1 commit C3 and I have a tag T pointing to that commit. Also, T will have a current timestamp. I'd prefer to get

               C4
               |
               V
          T -> C2
               |
               V
               C1

where T takes the commit message and date from C3. How can I achieve that?

Steve
Eric Wong· Jan 18, 2019, 22:31 UTC · re: Steve Keller · lore

Re: How to convert SVN tags to git tags?

Steve Keller <keller.steve@gmx.de> wrote:
> After converting from SVN to git using git svn init + git svn fetch,
> my SVN tags appear as remote branches in git.  I find many suggestions
> to convert these to git tags by calling git tag -a <tag-name> <branch-name>
> but this gives something like this

Hi Steve, instead of an annotated tag ("-a"), you can use a lightweight tag by omitting the "-a".

Fwiw, I chose to map SVN "tags" to remote branches in git since some projects I followed back in the day had moving tags in SVN.

← back to recent threads