Dieter Rehbein Dieter Rehbein - 3 months ago 14
Git Question

migration from svn to git 2.9.2 on windows

Migration from svn (server version 1.6.11) to git (version 2.9.2) on Windows 10 doesn't seem to work as described (I want to keep all svn-tags and branches).

First try:

I followed the tutorial provided at https://www.atlassian.com/git/tutorials/migrating-convert.

Result: all branches are deleted, when the following command is executed:

java -Dfile.encoding=utf-8 -jar ~/svn-migration-scripts.jar clean-git
--force


Next try:

I followed the steps described at https://git-scm.com/book/it/v2/Git-and-Other-Systems-Migrating-to-Git:


  • checkout the project:
    git svn clone --stdlayout --authors-file=authors.txt --no-metadata http://<the-svn-url-without-trunk> <module-directory>

  • After checking out the command
    git tag -l
    produces empty output.

  • git branch -a
    produces the following output (as expected):

    *master
    remotes/origin/tags/de-vgwort-jerry-configuration-1.0.0
    remotes/origin/tags/de-vgwort-jerry-configuration-1.0.1
    remotes/origin/tags/de-vgwort-jerry-configuration-1.0.2
    remotes/origin/tags/de-vgwort-jerry-configuration-1.1.0
    remotes/origin/tags/de-vgwort-jerry-configuration-1.2.0
    remotes/origin/tags/de-vgwort-jerry-configuration-1.3.0
    remotes/origin/tags/de-vgwort-jerry-configuration-1.4.0
    remotes/origin/tags/de-vgwort-jerry-configuration-1.4.1
    remotes/origin/tags/de-vgwort-jerry-configuration-1.5.0
    remotes/origin/trunk



The next step according to the documentation:

To move the tags to be proper Git tags, run

$ cp -Rf .git/refs/remotes/origin/tags/* .git/refs/tags/
$ rm -Rf .git/refs/remotes/origin/tags


The problem:

The path
.git/refs/remotes/origin/tags/
is empty. All the svn-tags seem to be located at

.git/svn/refs/remotes/origin/tags


The directory
.git/svn/refs/remotes/origin/tags
contained a subdirectory for each tag. I tried to move these directories to
.git/refs/tags/
but this leads to the following output, when executing
git branch -a
:

warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.0.0/index
warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.0.0/unhandled.log
warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.0.1/index
warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.0.1/unhandled.log
warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.0.2/index
warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.0.2/unhandled.log
warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.1.0/index
warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.1.0/unhandled.log
warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.2.0/index
warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.2.0/unhandled.log
warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.3.0/index
warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.3.0/unhandled.log
warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.4.0/index
warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.4.0/unhandled.log
warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.4.1/index
warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.4.1/unhandled.log
warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.5.0/index
warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.5.0/unhandled.log
* master
remotes/origin/tags/de-vgwort-jerry-configuration-1.0.0
remotes/origin/tags/de-vgwort-jerry-configuration-1.0.1
remotes/origin/tags/de-vgwort-jerry-configuration-1.0.2
remotes/origin/tags/de-vgwort-jerry-configuration-1.1.0
remotes/origin/tags/de-vgwort-jerry-configuration-1.2.0
remotes/origin/tags/de-vgwort-jerry-configuration-1.3.0
remotes/origin/tags/de-vgwort-jerry-configuration-1.4.0
remotes/origin/tags/de-vgwort-jerry-configuration-1.4.1
remotes/origin/tags/de-vgwort-jerry-configuration-1.5.0
remotes/origin/trunk


Next try

Use svn2git from https://github.com/nirvdrum/svn2git. But this tool doesn't seem to work either. After running

svn2git <svn-url-without-trunk> --authors ..\authors.txt


the command
git branch -a
produced the following output:

* master
remotes/svn/trunk


=> This result is quite useless.

What am I missing here? Is there any documentation applicable for Windows and the latest git version 2.9.2?

Answer

For a one-way import, you can try subgit import

SubGit has a free offer for import, and it generally is more complete than git svn.

Comments