Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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.

share|improve this question
1  
related to this: stackoverflow.com/questions/4992577/msys-git-and-long-paths –  Michael Oct 23 '11 at 13:30

2 Answers 2

up vote 5 down vote accepted

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.