2

I have a production SVN repository that i want to clone with git. when I try to git svn clone it I get error that has to do with some files that have a long combination of path filename.

I figure that this is a limitation caused by the GNU shell mingw32 that git uses to run since neither windows or unix has this kind of limitation.

Is there anyway to overcome this limitation ? I don't want to start changing the filenames/paths before i'm sure that I want to move to git.

Thanks.

Michael
  • 22,196
  • 33
  • 132
  • 187

3 Answers3

5

This is a limitation Windows in that the MAX_PATH is 260 characters, that is a path can have a maximum of 260 characters ( so once you account for the driver letter, the colon and the initial \ and the trailing NUL, you have 256 characters for your path).

Windows has a unicode path which can have length of about 32,767. You can get such a path by prefixing the paths with \\?\

See here for details: http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx

You can also look at using subst to substitute a long path with a drive name and operate on that.

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/subst.mspx?mfr=true

The above are ways to overcome the limitation, but may not be wasy to apply during a git svn clone,of course. Make sure the path that you start off the clone in, is as short as possible. Use subst to assign a drive letter to the path where you are cloning and use that drive.

manojlds
  • 290,304
  • 63
  • 469
  • 417
0

I am on Windows XP and had the same problem. I followed the solution above using subst and it worked, as follows:

First, in the command prompt: subst z: c:\my\rather\long\path\to\local\repo\

Then in git: git clone https://github.com/my/repo z:/repo_name

A repository that was previously too long now cloned to my PC.

NewZeal
  • 133
  • 3
0

The above solution worked. Additional to that, the old repo path may be still show brocken in tortoicegit with its full lenth windows path, But if you go to windows explorer and take the new drive letter which will result after subst command, u can see the proper repo and tortoicegit will work perfectly there.

sajin tm
  • 323
  • 3
  • 9