9

I use git-svn on windows for the first time , git svn rebase show error:

fatal: index file open failed: Invalid argument

Why it happened and how can i fix it ?

Thanks.

2 Answers 2

12

If you are using msysgit on windows, there is a regression on msysgit1.8.4 for git-svn.
It seems to appear when executed in a CMD, not in a bash shell, so you can try that same command in a shell.

Or you can SubGit, which is much more complete and robust tool for transitionning from svn to git repo. Listen to his author at GitMinutes #22.


The regression is in progress to be fixed (currently -- October 2013 -- in the 'next' branch of the git repo) Bas Bossink confirms in the comments:

I just verified that it is fixed in git 1.8.5.2.msysgit.0

See commit 7fbd42, by jiangxin:

Tvangeste found that the "relative_path" function could not work properly on Windows if "in" and "prefix" have DOS drive prefix (such as "C:/windows"). ($gmane/234434)

E.g., When execute: test-path-utils, relative_path "C:/a/b" "D:/x/y" should return "C:/a/b", but returns "../../C:/a/b", which is wrong.

So make relative_path honor DOS drive prefix.

Sign up to request clarification or add additional context in comments.

3 Comments

@amy yes, downgrading is one solution. This should be fixed in 1.8.5 hopefully.
@VonC I just verified that it is fixed in git 1.8.5.2.msysgit.0.
@BasBossink great! I have included your comment in the answer for more visibility.
0

I was seeing this problem when using --separate-git-dir with working directory and git directory on separate drives (git on a network drive in my case). As a workaround I've confirmed that you can use mklink (run as admin) to map the target drive: mklink /d "C:\temp\my-git-dir" "D:\my-git-repo\"

Then something like the following will produce a viable repo and working dir. git clone --no-hardlinks repo_url --separate-git-dir=D:/my-git-repo C:/temp/my-working-dir

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.