git svn rebase index file open failed : Invalid argument

时光毁灭记忆、已成空白 提交于 2019-12-10 02:24:55

问题


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.


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/19511044/git-svn-rebase-index-file-open-failed-invalid-argument

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!