git svn 克隆:来自 SVN 的错误,(220001):项目不可读

git svn clone: Error from SVN, (220001): Item is not readable

我在尝试从远程 svn 服务器构建 git 存储库时遇到此错误,似乎很多人遇到此问题的原因各不相同。所有 google 结果对我都不起作用,我只是用模糊解决方案修复了错误。

错误:

git svn fetch

W: Item is not readable at /Applications/Xcode.app/Contents/Developer/usr/share/git-core/perl/Git/SVN.pm line 154.

Error from SVN, (220001): Item is not readable

关键目标不是git-svn而是svn.

我用命令 svn list 检查了 svn 权限并得到了权限被拒绝的错误,然后指定了参数“--username myname”和“--config-dir”。对于 list 命令,在 svn 将我的 svn 配置保存在某处后,运行 "git svn clone repo_url",它起作用了!

我偶然修复了这个错误,这是我的猜测,git-svn 在其内部实现中从文件“/Applications/Xcode.app/Contents/Developer/usr/share/git-core/perl/Git/SVN.pm 第 154 行调用了 svn 命令",因此 svn 必须具有足够的权限才能检出存储库。

我没有找到准确的答案,在这里分享我的代码经验。

祝你好运!

那是因为没有权限。在您的 SVN 服务器上,打开位于存储库配置目录中的 "authz" 文件。添加以下行以允许 read-only 访问每个人:

[/]
* = r

您可能希望在完成迁移后撤销访问权限。

我遇到了类似的问题,但在我的情况下,这不是由于缺少权限引起的,而是 git-svn 在 [= 下创建并使用了自己的 .subversion 配置文件夹这一事实11=],而 svn 正在使用 %APPDATA% 下的 Subversion 文件夹。

我的解决方案是从 %USERPROFILE% 中删除 .subversion 文件夹并在其位置创建指向 svn 配置目录 %APPDATA%\Subversion 的符号链接(名为 .subversion)。

Git svn does not use the svn credentials

可能是凭据问题 -- .subversion 文件夹无法提供凭据。看看我的回答,可能会有帮助。

The reason why git-svn does not use SVN is that it use the credentials stored at C:\Users\XXXX.subversion, which is created by git-svn but not SVN. In my case, Error from SVN, (220001): Item is not readable: Item is not readable also occur.

The solution is to move the credentials from SVN to git-svn:

  1. Use SVN to check out from server. Remember to save auth. This can create credentials for SVN. The files are stored at C:\Users\XXXXX\AppData\Roaming\Subversion.
  2. Remove the .subversion folder which is under user directory C:\Users\XXXXX if it exists. And then copy the C:\Users\XXXXX\AppData\Roaming\Subversion folder to C:\Users\XXXXX.
  3. Then rename it to .subversion. Since the name starts with a ".", you may need to rename it in cmd console with "rename" command.
  4. Finally, you can use git-svn clone.

如果 authz 配置文件中缺少别名部分,就会发生这种情况