1

I'm importing a svn repository into git using git svn. I'm using Git-1.8.0-preview20121022 on Windows Server 2008 R2.

The import's been running for a while and has fetched the first 4000 revisions without incident. However, it now seems to have come across a branch name with a trailing space and it has fallen over.

$ git svn fetch
Found possible branch point: https://10.10.10.2/svn/project/trunk => https://10.10.10.2/svn/project/branches/Release%2020110929%20, 3976
Found branch parent: (refs/remotes/Release 20110929 ) 691fb7f7d11cbb1afe35106f60a1d117ba415f4c
fatal: Unable to create 'd:/GitMigration/project/.git/svn/refs/remotes/Release 20110929 /index.lock': No such file or directory
read-tree 691fb7f7d11cbb1afe35106f60a1d117ba415f4c: command returned error: 128

This branch doesn't exist any more so I can't change the name in the normal way. The directory exists without the trailing space in the name but I can't find a way to rename it that preserves the space.

Is there anything I can do about this?

alnorth29
  • 3,525
  • 2
  • 34
  • 50

3 Answers3

1

The root cause of the issue - GIT creates a directory with a trailing space but in fact its name is truncated. For example Windows mkdir likes to do that. GIT doesn't expect that and continues to use name with a space and fails to find a dir.

It can be fixed manually. Use FAR, GnuWin or any other tool which can make a directory with a trailing space. Then rename "d:/GitMigration/project/.git/svn/refs/remotes/Release 20110929" to "d:/GitMigration/project/.git/svn/refs/remotes/Release 20110929". As you can see that's the directory GIT was expecting to find.

Then run git svn fetch again.

  • Space was truncated in my answer also. Rename to a dir with a trailing space. Just copy/paste everything (including spaces) between "Unable to create '" and "/index.lock". – user3518880 Mar 20 '15 at 05:48
0

In the end I gave up on importing this in Windows. There are hacky solutions out there I'm sure, but it's much easier just to do this in Linux then pull it from there to Windows. This should work fine as long as the branch isn't current.

alnorth29
  • 3,525
  • 2
  • 34
  • 50
0

There is a manual workaround this issue. Try creating the the DIR manually. To avoid trimming of white trailing white space you can add "\?\ at the beginning of the path" in cmd command. e.g.

mkdir "\\?\d:\GitMigration\project\.git\svn\refs\remotes\Release 20110929 "
Vilius
  • 77
  • 3