Migrate from svn to git keeping svn-externals
Asked Answered
C

1

6

I am migrating from an svn repository to git. This svn repository has svn-externals, to be kept on svn repositories. These external are versioned and tagged in the history, and are read only. How I can properly migrate and have the svn-externals in the new git repository properly set?

I am looking in "git svn propset", git submodules, subtree merges. But How I can set up such a repository?

Callous answered 10/3, 2017 at 10:33 Comment(2)
I guess you can't do "git svn propset" for track svn:externals, with git, right?Callous
git svn propset does nothing in Git, it just sets SVN properties in the tracked SVN repository. You can use it to manage the svn:externals that the SVN repo trackes, but it will have no effect on the Git clone.Pocket
C
0

Alternatively, I propose: Use a modified version of this simple old python script, that works: https://github.com/eneroth/git-externals This script would check out all svn:externals previously defined in subdirectory in a .gitexternals file Problem is the checked out version is the HEAD, and are not part of the git repository

I would use a separate file, to use to store all svn versions. This file would be stored in git. So each time we do an update, This file would be updated with the latest commited. An option in the script would allow to update this file to the latest version of externals. The script would be modified to download the version stored in such file. Branches and tags would have the version fixed for externals as well in this case. For the historical data of the migration, not sure if this approach would work.

I would use this script in the case of submodules as well, it’s quite flexible. But in that case we will have all externals mirrored in git

Callous answered 17/3, 2017 at 9:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.