I am in the process of moving all of our projects from Subversion to Git. For projects that did not need to retain any branches, I have had success using git-svn in a manner that purposely ignored all branches & tags.
I am now using the "KDE Version" of svn2git (a.k.a. svn-all-fast-export) to work on a couple of Svn repos where branches must be carried forward.
To prepare for the conversion, I created a dmp file:
svnadmin create /opt/csvn/data/repositories/svnrepo
svnrdump https://<serverurl>/svn/thisproject > svn.dump # Has branches, tags, trunk structure
svnadmin load /opt/csvn/data/repositories/svnrepo < svn.dump
My svn list file:///opt/csvn/data/repositories/v2_cleaned/ shows the directories branches, tags & trunk as expected.
My rules file:
create repository testrepo
end repository
match /trunk/
repository testrepo
branch master
end match
match /branches/manufacturing/
repository testrepo
branch manufacturing
end match
# Ignore all other directories
match /
end match
Then, I ran the conversion from a directory that contains other working repositories (including svn2git & kde-ruleset):
./svn2git/svn-all-fast-export --debug-rules --identity-map=./Authors.map --rules=./Conversions/v2togit/rules-file --stats --add-metadata /opt/csvn/data/repositories/svnrepo/
The conversion finished extremely fast, in less than a minute...
My problem:
If I cd into the testrepo directory and run "git branch", it shows *master and manufacturing, which per my rules file above seems fine.
However if run "git status", or "git checkout manufacturing" I receive the message:
fatal; this operation must be run in a work tree
Looking at the directory tree of the repository, there is no .git directory, nor are the expected files and directories of "trunk" present. Also when comparing the contents of other Git repositories, the contents of the "good" .git directory seem to be present at the top level of this directory.
I tried manually creating .git and moving things into it to match "good" repos, but that didn't help.
It seems I missed a step or perhaps am not invoking svn-all-fast-export with the correct incantation.
Version information:
- Ubuntu 21-10 VM
- svn, version 1.14.1 (r1886195)
- git, version 2.32.0
- KDE svn2git version of yesterday when I cloned and built it.
And these migrations are intended to be one-time conversions, have no interest in supporting the Svn OR Git workflow that I have read about (I have enough nightmares already).
Thank you in advance.