xcode XCode4 添加存储库主机无法访问?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6748387/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
XCode4 add Repository Host Unreachable?
提问by MonkeyBlue
I'm trying to add a remote linux SVN repository to my project but when I enter the server address I get the message Host is unreachable.
我正在尝试将远程 linux SVN 存储库添加到我的项目中,但是当我输入服务器地址时,我收到消息主机无法访问。
I'm entering it like
我正在输入它
svn://ip_address/myproject/
From terminal I can do this
从终端我可以做到这一点
svn list svn://ip_address/myproject/
and it shows the contents without any issues.
它显示的内容没有任何问题。
回答by Josh Metcalfe
I had this problem as well in linking to a Git repository. It seems XCode has some issues with IP addresses. I found that by modifying my hosts (/private/etc/hosts on Mac) file and adding an entry for the repository's IP address does the trick.
我在链接到 Git 存储库时也遇到了这个问题。XCode 似乎在 IP 地址方面存在一些问题。我发现通过修改我的主机(Mac 上的 /private/etc/hosts)文件并为存储库的 IP 地址添加一个条目可以解决问题。
Hosts file entry:
主机文件条目:
i.p.add.ress serverName #where i.p.add.ress is your ip_address
In the Location field in XCode:
在 XCode 的 Location 字段中:
svn://serverName/myproject
The comments above referencing the other question's answer doesn't cover the IP address issue. Hopefully this will fix your issue too.
上面引用其他问题答案的评论并未涵盖 IP 地址问题。希望这也能解决您的问题。
回答by Placebo
To modify the host file you open the terminal and put this command:
要修改主机文件,请打开终端并输入以下命令:
sudo nano /private/etc/hosts
Now you have opened with "nano editor" the file hosts, add IP, save and close. After you put this code in the terminal to reflush dns:
现在您已经使用“纳米编辑器”打开了文件主机,添加 IP,保存并关闭。将此代码放入终端以刷新 dns 后:
dscacheutil -flushcache
dscacheutil -flushcache
END!
结尾!
回答by Frost
This is probably not the solution to the issue the original poster was experiencing, but the same error message can be received for a different reason, which is why I post this.
这可能不是原始发布者遇到的问题的解决方案,但由于不同的原因可能会收到相同的错误消息,这就是我发布此信息的原因。
Xcode has trouble with ssh login banners.
Xcode 有 ssh 登录横幅的问题。
Quite simply, if your svn server is accessed via svn+ssh and is making use of a login banner, Xcode will state that your repository cannot be reached. Comment out the Banner
entry in /etc/sshd_config, and there should be one less reason why you cannot reach your repository.
很简单,如果您的 svn 服务器是通过 svn+ssh 访问的并且正在使用登录横幅,则 Xcode 将声明您的存储库无法访问。注释掉Banner
/etc/sshd_config 中的条目,您无法访问存储库的原因应该少了一个。
回答by Puo
I also came across this with hard luck. How I fixed my broken repository is as follows.
我也很幸运地遇到了这个问题。我如何修复损坏的存储库如下。
- Start XCode and check out or clone a new repository.
- Copy the git HTTPS clone URL.
- Paste into the Xcode field and remove the "S" of HTTPS.
- Press clone button
- When the "verify Certificate" popup appears make sure to set it to "Always Trust"
- If needed to enter git username password save that to the keychain.
- In the original "broken repository" Open the XCode organizer click the remotes folder and expand "origin"
- If no branch appears enter username and password and the remote will now appear
- 启动 XCode 并签出或克隆一个新的存储库。
- 复制 git HTTPS 克隆 URL。
- 粘贴到 Xcode 字段并删除 HTTPS 的“S”。
- 按克隆按钮
- 当“验证证书”弹出窗口出现时,确保将其设置为“始终信任”
- 如果需要输入 git 用户名密码,请将其保存到钥匙串。
- 在原来的“broken repository”打开XCode管理器,点击remotes文件夹,展开“origin”
- 如果没有出现分支,请输入用户名和密码,现在将出现遥控器
Hope this helps
希望这可以帮助