Git svn import branch with trailing space

I am importing a svn repository into git using git svn

. I am using Git -1.8.0-preview20121022 on Windows Server 2008 R2.

The import has been running for a while and has extracted the first 4000 patches without incident. However, now it seems to have met the name of the branch with a finite space and fell.

$ 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 no longer exists, so I cannot change the name in the usual way. The directory exists without a trailing space in the name, but I can't find a way to rename it while saving space.

What can I do about it?

+1


source to share


3 answers


I ended up giving up on importing this on Windows. There are hacky solutions out there, I'm sure, but it's much easier to do it on Linux and then pull it from there on Windows. This should work fine as long as the branch is not current.



0


source


The root cause of the problem is that GIT creates a directory with a trailing space, but in reality its name is truncated. For example, Windows mkdir loves to do this. GIT does not expect this and continues to use the name with a space and cannot find the directory.

You can install it manually. Use FAR, GnuWin, or any other tool that can create a directory with a finite 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, expected to find a GIT directory.



Then start git svn fetch

again.

+1


source


There is a manual workaround. Try to create the DIR manually. To avoid trimming the white trailing space, you can add "\? \ At the beginning of the path" to the cmd command. eg

mkdir "\\?\d:\GitMigration\project\.git\svn\refs\remotes\Release 20110929 "

      

0


source







All Articles