SVN 笔记:从SVN服务器下载代码到本地,无法连接到VisualSVN Server

版权声明:本文所有内容均为博主原创手打,转载请注明出处,如有雷同,不甚荣幸。 https://blog.csdn.net/Xu_JL1997/article/details/83185866

使用checkout指令从SVN服务器下载代码一定要注意格式。

svn checkout svn://xxx.xxx.xxx.xxx/ --username=your_name --password=your_password

这是网上许多教程给出的答案,但却遗漏了比较重要的一点,那就是SVN服务器的协议。

重点:需要根据协议来书写名令才能正确拉取代码,有svn协议和http协议。

如果使用类似于VisualSVN Server这种基于http协议的SVN服务器,不能使用上面这种格式,需要通过http请求来拉取代码。否则就会报下面的错误,无法连接到ip所在的SVN服务器。

svn: E170013: Unable to connect to a repository at URL 'svn://xxx.xxx.xxx.xxx/dir'
svn: E000060: Can not connect to host 'xxx.xxx.xxx.xxx': Operation timed out

正确格式:

# 修改协议为https,也可以试一下http
svn checkout https://xxx.xxx.xxx.xxx/ --username=your_name --password=your_password

或者直接登录网页,成功登录后把URL复制下来,将路径替换。
登录后的页面:
在这里插入图片描述

复制URL:
在这里插入图片描述
替换命令中的路径:

svn checkout https://xxx.xxx.xxx.xxx/ --username=your_name --password=your_password

结论:一定要清楚SVN使用的协议,正确发出请求,可以参考下下面的文章
【SVN】——svn协议和http协议

猜你喜欢

转载自blog.csdn.net/Xu_JL1997/article/details/83185866