Xcode 4 + SVN = 工作?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5376422/
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
Xcode 4 + SVN = working?
提问by ninjaneer
I have a VPS with Centos running. I have setup subversion on the VPS. While setting it up in Xcode, Xcode reports that everything is fine. When I import a project however, Xcode gives a warning:
我有一个运行 Centos 的 VPS。我在 VPS 上设置了 subversion。在 Xcode 中进行设置时,Xcode 报告一切正常。但是,当我导入项目时,Xcode 会发出警告:
Authentication realm: <svn://**********.net:3690> **********-**********
Password for 'svn':
Authentication realm: <svn://**********.net:3690> **********-**********
Username: svn: Can't read stdin: End of file found
I can't even create directories, but Xcode reports that it can connect to it fine. I have put in the correct user name and password.
我什至无法创建目录,但 Xcode 报告它可以正常连接到它。我输入了正确的用户名和密码。
I am able to get a third party plugin working in visual studio working at the same address so I know it's not the server that's giving problems. I've uploaded some files using visual studio.
我能够让在 Visual Studio 中工作的第三方插件在同一地址工作,所以我知道不是服务器出现问题。我已经使用 Visual Studio 上传了一些文件。
Has anyone got subversion working in their xcode 4?
有人在他们的 xcode 4 中使用 subversion 吗?
回答by NaJeWang
I solved the problem this way
我这样解决了这个问题
1.open a terminal
1.打开终端
2.type 'svn list svn://~~~paths'
2.type 'svn list svn://~~~paths'
ie. "NJW-Mac:~ bluepin$ svn list svn://192.168.0.184/BMA"
IE。"NJW-Mac:~ bluepin$ svn list svn://192.168.0.184/BMA"
3.You will need to enter PCUserPassword,svnUserID,svnUserPassword
3.您需要输入PCUserPassword,svnUserID,svnUserPassword
4.U should see output from the svn list command which means you were able to connect to the SVN server
4.U 应该看到 svn list 命令的输出,这意味着您能够连接到 SVN 服务器
5.return to xcode4
5.返回xcode4
6.try again your job(connect Repositories)
6.重试你的工作(连接存储库)
If u access your SVN repository from the terminal once it should allow you to connect to the repositories using Xcode (I suspect the subversion credentials have to be cached somewhere).
如果您从终端访问您的 SVN 存储库,它应该允许您使用 Xcode 连接到存储库(我怀疑 subversion 凭据必须缓存在某处)。
回答by Fogger
Ever since I started using Xcode I've had no problems connecting to my subversion repository using an ip address instead of the hostname. eg. http://192.168.1.xxx/svn
自从我开始使用 Xcode 以来,我使用 IP 地址而不是主机名连接到我的 subversion 存储库没有任何问题。例如。http://192.168.1.xxx/svn
When Xcode 4 came out for Snow Leopard, it worked fine as well. But since upgrading to Lion and the updated Xcode 4, whatever I did it refused to connect to the repository. I could connect without a problem from the shell with 'svn list http://192.168.1.xxx/svn', but not from Xcode. I tried removing the password from the repository. That didn't work so I put the password back in.
当 Xcode 4 用于 Snow Leopard 时,它也运行良好。但是自从升级到 Lion 和更新的 Xcode 4 后,无论我做什么,它都拒绝连接到存储库。我可以使用'svn list http://192.168.1.xxx/svn'从shell连接而没有问题,但不能从Xcode连接。我尝试从存储库中删除密码。那没有用,所以我把密码放回去了。
I tried removing any references to the repository from my keychain, but that didn't work either. It wouldn't trigger an authentication window in Xcode. Using 'svn list http://192.168.1.xxx/svn' from the shell gave me the authentication window, and it connected successfully. It added an entry into the keychain, but Xcode still didn't work. I tried adding Xcode to the access control list for the new keychain entry, and that didn't work either.
我尝试从我的钥匙串中删除对存储库的任何引用,但这也不起作用。它不会在 Xcode 中触发身份验证窗口。使用shell 中的'svn list http://192.168.1.xxx/svn' 为我提供了身份验证窗口,并且连接成功。它在钥匙串中添加了一个条目,但 Xcode 仍然无法正常工作。我尝试将 Xcode 添加到新钥匙串条目的访问控制列表中,但这也不起作用。
I found another thread herewith a small comment about adding an entry for the svn server to the /etc/hosts file, so I thought I'd give that a go.
我在这里找到了另一个线程,其中有一条关于将 svn 服务器的条目添加到 /etc/hosts 文件的小评论,所以我想我会试一试。
192.168.1.xxx Subversion
After adding this line to the hosts file, everything started working perfectly in Xcode using http://Subversion/svnto connect to the repository. Connecting from the shell worked fine as well.
将此行添加到主机文件后,一切都开始在 Xcode 中完美运行,使用http://Subversion/svn连接到存储库。从外壳连接也很好。
It's probably worth mentioning that the new keychain entry shows 2 entries in the access control list for svn. One entry pointing to /opt/local/bin/svn, the other to /Developer/usr/bin/svn. After restarting Xcode, it requested access to the keychain. Now there is a third entry in the access list for Xcode. I tried adding these 2 entries that were added by Xcode to the access list for the keychain entry using the ip address, but Xcode still didn't work.
可能值得一提的是,新的钥匙串条目在 svn 的访问控制列表中显示了 2 个条目。一个条目指向 /opt/local/bin/svn,另一个指向 /Developer/usr/bin/svn。重新启动 Xcode 后,它请求访问钥匙串。现在 Xcode 的访问列表中有第三个条目。我尝试将 Xcode 添加的这 2 个条目添加到使用 ip 地址的钥匙串条目的访问列表中,但 Xcode 仍然无法正常工作。
Over the years I've seen some strange behaviour in OSX when authenticating to devices using an ip address. My web browser would sometimes find the keychain entry for my router when accessing it using an ip address, and other times it wouldn't. So to avoid all the wasted hours trying to diagnose these sorts of problems in the future, I'll be using the /etc/hosts file from now on.
多年来,当使用 IP 地址对设备进行身份验证时,我在 OSX 中看到了一些奇怪的行为。我的网络浏览器有时会在使用 IP 地址访问我的路由器时找到它的钥匙串条目,而其他时候则不会。因此,为了避免将来在尝试诊断此类问题时浪费所有时间,从现在开始我将使用 /etc/hosts 文件。
回答by mefm247
Credit to "makdiesel" who actually found this solution (which was the only one that worked for me)
归功于实际找到此解决方案的“makdiesel”(这是唯一对我有用的解决方案)
Open your /etc/hosts file and comment out the IPv6 lines (sudo vi /etc/hosts):
#::1 #fe80::1%lo0
Clear the dns cache (sudo dscacheutil - flushcache)
打开您的 /etc/hosts 文件并注释掉 IPv6 行 (sudo vi /etc/hosts):
#::1 #fe80::1%lo0
清除 dns 缓存 (sudo dscacheutil -flushcache)
Re-start Xcode and your SVN repositories should be working again.
重新启动 Xcode,您的 SVN 存储库应该会再次运行。
回答by mefm247
http://plainoldstan.blogspot.com/2011/03/xcode-4svn-could-not-authenticate-to.html
http://plainoldstan.blogspot.com/2011/03/xcode-4svn-could-not-authenticate-to.html
Seann is right, it was an issue that the SVN credentials hadn't been cached in an "Xcode 4-friendly" manner.
Seann 是对的,SVN 凭据没有以“Xcode 4 友好”的方式缓存是一个问题。
This fixed it for me. Basically, what I had to do was:
这为我修好了。基本上,我必须做的是:
- Close the project I'm trying to commit in Xcode.
- Open a terminal to the root folder.
- Run
svn cleanup
to remove any locks. svn commit
with either-m "Commit message here"
or--editor-cmd=anEditorIUse
. I used the latter, because I likevim
.- Save the text file and quit if you're using an editor.
- Enter your account password for OS X.
- Enter your SVN username.
- Enter your SVN password.
- 关闭我尝试在 Xcode 中提交的项目。
- 打开终端到根文件夹。
- 运行
svn cleanup
以移除所有锁。 svn commit
与-m "Commit message here"
或--editor-cmd=anEditorIUse
。我使用后者,因为我喜欢vim
.- 如果您使用的是编辑器,请保存文本文件并退出。
- 输入您的 OS X 帐户密码。
- 输入您的 SVN 用户名。
- 输入您的 SVN 密码。
Hallelujah.
哈利路亚。
回答by majkelx
If command line svn uses KeyChain (default on MacOS) and sill ask you about svn password this could be an solution:
如果命令行 svn 使用 KeyChain(MacOS 上的默认值)并询问您有关 svn 密码的信息,这可能是一个解决方案:
- Suppose you are OK with
~/.subversion
configuration folder (default settings, backup and delete folder to be sure) - Run
Key Chain.app
- In 'login' chain find passwords containing 'svn'
- For passwords which match your server dbl-click and in "Access Control" allow access without confiramtion (I do not know exact names of UI lables in English MacOS).
- Command line should stop asking about password, Xcode4 will fix also.
- 假设你对
~/.subversion
配置文件夹没问题(默认设置,备份和删除文件夹是肯定的) - 跑
Key Chain.app
- 在“登录”链中找到包含“svn”的密码
- 对于与您的服务器 dbl-click 和“访问控制”匹配的密码,无需确认即可访问(我不知道英文 MacOS 中 UI 标签的确切名称)。
- 命令行应该停止询问密码,Xcode4 也会修复。
回答by Corin
Having just spent the morning fighting with XCode and SVN, I think I have a solution that does not require using any terminal prompts. This is for connecting to an existing repository.
刚刚花了一个上午的时间与 XCode 和 SVN 斗争,我想我有一个不需要使用任何终端提示的解决方案。这是用于连接到现有存储库。
- Checkout or Clone Repository
- Enter host location
- Supply the name and select Subversion for the type
- Select the local destination folder and click Checkout
- Enter username and password when prompted
- When the failure message appears indicating access was denied, click Try again
- Click Checkout on the prompt for the local destination folder without changing anything
- Select replace on the confirmation of the folder.
- 签出或克隆存储库
- 输入主机位置
- 提供名称并为类型选择 Subversion
- 选择本地目标文件夹,然后单击结帐
- 出现提示时输入用户名和密码
- 当出现指示访问被拒绝的失败消息时,单击再试一次
- 在提示输入本地目标文件夹时单击 Checkout 而不更改任何内容
- 确认文件夹后选择替换。
Done. It seems to require two connection attempts before it works. I've tried this on a couple different computers now and it's worked every time.
完毕。它似乎需要两次连接尝试才能工作。我现在已经在几台不同的计算机上尝试过这个,并且每次都有效。
回答by mizzle
I had a similar problem; was working in XCode 3 blah blah...
我有一个类似的问题;正在使用 XCode 3 等等等等...
I followed all the instructions here and herebut still it was hanging.
我按照此处和此处的所有说明进行操作,但它仍然挂起。
The problem was that my svn username and my mac OS username and password were the same. Once I'd changed the name of my svn user it worked!
问题是我的 svn 用户名和我的 mac OS 用户名和密码是一样的。一旦我更改了我的 svn 用户的名称,它就起作用了!
Hope this prevents anyone else spending a day's work on this
希望这可以防止其他人为此花费一天的时间
回答by Sigi
I you have checked out the project already, just remove the repo Organizer and open a terminal with the project directory.
我已经检查了项目,只需删除 repo Organizer 并打开一个包含项目目录的终端。
Now type:
现在输入:
svn list
This will ask for the svn credentials and svn integration for this project should work in Xcode now.
这将要求提供 svn 凭据,该项目的 svn 集成现在应该可以在 Xcode 中工作。
回答by Eric Brotto
NaJeWang
's answer pretty much nails it, but for me it was as simple as
NaJeWang
's answer几乎钉它,但对我来说它很简单
- Entering my user passwordfor my machines user account.
- Entering my user namefor my svn account.
- Entering my passwordfor my svn account.
- 为我的机器用户帐户输入我的用户密码。
- 为我的svn 帐户输入我的用户名。
- 输入我的密码,我的svn帐户。
And that did it!
做到了!
回答by reddersky
I had this problem when I moved my SVN server from one box to another. Xcode refused to accept the credentials added onto the repos page.
当我将我的 SVN 服务器从一个盒子移到另一个盒子时,我遇到了这个问题。Xcode 拒绝接受添加到 repos 页面的凭据。
The solution I found that worked was to remove the repo from the list, quit Xcode, then open the source-controlled project again.
我发现有效的解决方案是从列表中删除 repo,退出 Xcode,然后再次打开源代码控制的项目。
This then correctly prompted me for the SVN password. After this, it all worked fine.
然后这正确地提示我输入 SVN 密码。在此之后,一切正常。