执行git svn clone遇Access forbidden,如何成功克隆SVN仓库?
SVN仓库克隆失败问题排查与解决
问题现象
- 执行
git svn clone http://<IP-address of the host>:<port>/svn/<name of the project>/java/common -s -r 10:HEAD初始化Git仓库后报错:
Can't create session: Unable to connect to a repository at URL 'http://<IP-address of the host>:<port>/svn/<name of the project>/java/common': Access to '/svn/<name of the project>/java/common' forbidden at C:/Program Files/Git/mingw64/share/perl5/Git/SVN.pm line 310.
对应SVN.pm文件309-311行代码:
} elsif ($_minimize_url) { my $min_url = Git::SVN::Ra->new($url)->minimize_url; $existing = find_existing_remote($min_url, $r);
- 直接执行SVN检出命令
svn co http://<IP-address of the host>:<port>/svn/<name of the project>/java/common,输入用户名zolotarevsa和密码后仍提示:
svn: E170013: Unable to connect to a repository at URL 'http://<IP-address of the host>:<port>/svn/<name of the project>/java/common' svn: E175013: Access to '/svn/<name of the project>/java/common' forbidden
- 执行
svn info http://<IP-address of the host>:<port>/svn时,出现服务器内部错误:
svn: E170013: Unable to connect to a repository at URL 'http://10.0.0.1:83/svn' svn: E175002: Unexpected server error 500 'Internal Server Error' on '/svn'
原因分析
- 权限不足是核心嫌疑:入职第一天新账号大概率未完成对应SVN仓库路径的权限配置
- SVN根路径返回500错误,可能是服务器自身配置异常,或账号连根目录访问权限都未被授予
解决步骤
- 第一时间联系团队运维或SVN管理员,确认账号
zolotarevsa是否已被授予<name of the project>/java/common路径的读权限 - 同步反馈
svn info触发500错误的情况,让管理员检查SVN服务器的运行状态、路径配置是否正常 - 请同事用他们的有效账号测试相同SVN路径的检出操作,排除仓库URL填写错误的可能
- 若管理员确认权限无误,执行
svn cleanup清除本地缓存的错误凭证,重新输入用户名密码尝试操作 - 检查本地Git SVN工具版本与服务器端SVN版本是否兼容,版本不匹配可能导致连接异常
内容的提问来源于stack exchange,提问作者Powet
相关产品推荐
相关产品推荐

