无法连接到VisualSVN Server,无法连接SVN服务器
使用checkout
指令从SVN服务器下载代码一定要注意格式。
# 将svn服务器上的 "dir"文件夹拷贝到本地 "/Users/local_dir"
svn checkout svn://xxx.xxx.xxx.xxx/dir --username=your_name --password=your_password /Users/local_dir
这是网上许多教程给出的答案,但却遗漏了比较重要的一点,那就是SVN服务器的协议。
需要根据协议来书写名令才能正确拉取代码,有svn协议和http/https协议。
如果使用类似于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/dir --username=your_name --password=your_password /Users/local_dir
如下图:
结论
一定要清楚SVN服务器使用的协议,正确发出请求。
参考
【SVN】——svn协议和http协议
还没有评论,来说两句吧...