I’ve used svn2git (running on Debian) to try migrating an SVN repository to Git and then pushed to GitHub:
svn2git https://localhost/svn/test-repository/space-invaders --username user
git remote add origin https://github.com/my-username/space-invaders.git
git push --all
The source SVN repository has lots of tags:
But afterwards, no tags have made it into GitHub:
I’ve seen the FAQ, but to be honest I don’t really understand it. The tags aren’t showing up in the gitk
UI either.
I did try using GitHub’s own importer, but this didn’t preserve any of the history which was very frustrating.
svn2git
output:
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: git branch -m <name>
Initialized empty Git repository in /home/user/space-invaders/.git/
Authentication realm: <https://localhost:443> VisualSVN Server
Password for 'user':
Using higher level of URL: https://localhost/svn/test-repository/space-invaders => https://localhost/svn/test-repositoryAuthentication realm: <https://localhost:443> VisualSVN Server
Password for 'user':
r1 = bcfeab442a701895d74113928cbb08bacefc9602 (refs/remotes/svn/trunk)
A thecode
r3 = 2c0b0ea6b3517e461349ac8249ee89fa1df96367 (refs/remotes/svn/trunk)
Found possible branch point: https://localhost/svn/test-repository/space-invaders/trunk => https://localhost/svn/test-repository/space-invaders/tags/1.0.47, 3
Found branch parent: (refs/remotes/svn/tags/1.0.47) 2c0b0ea6b3517e461349ac8249ee89fa1df96367
Following parent with do_switch
Successfully followed parent
r4 = 48ce984471a4343d07c8b079d63641a1da81389b (refs/remotes/svn/tags/1.0.47)
M thecode
r5 = 289433f53f435964559244876638de2fa973e4a3 (refs/remotes/svn/trunk)
Found possible branch point: https://localhost/svn/test-repository/space-invaders/trunk => https://localhost/svn/test-repository/space-invaders/branches/branch_2.0.20_bleh, 5
Found branch parent: (refs/remotes/svn/branch_2.0.20_bleh) 289433f53f435964559244876638de2fa973e4a3
Following parent with do_switch
Successfully followed parent
r6 = 9dff5da18bdd734e50ec187a314d1c61fad8b41c (refs/remotes/svn/branch_2.0.20_bleh)
M thecode
r7 = bc1495b49c729cf789d896847ba7b4b6b55e01f1 (refs/remotes/svn/branch_2.0.20_bleh)
M thecode
r8 = d73dc60e8518c1695e2a6d3f0e10d11bfdbfd1bd (refs/remotes/svn/trunk)
Found possible branch point: https://localhost/svn/test-repository/space-invaders/trunk => https://localhost/svn/test-repository/space-invaders/tags/2.0.24, 8
Found branch parent: (refs/remotes/svn/tags/2.0.24) d73dc60e8518c1695e2a6d3f0e10d11bfdbfd1bd
Following parent with do_switch
Successfully followed parent
r9 = 491aa2e3f1a64f032ebdd5e76577302ebdfdbabf (refs/remotes/svn/tags/2.0.24)
Checked out HEAD:
https://localhost/svn/test-repository/space-invaders/trunk r8
2
Answers
svn2git
was working correctly - I could see it when I rangit tag
on the local repositorysvn2git
produced.But git
push --all
only pushes branches, not tags - I needed to rungit push --tags
as well.Following this the tags were showing correctly.