如何更改 xcode 中的颠覆设置?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1127134/
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
How to change subversion settings in xcode?
提问by Rich
I've had subversion running in Xcode for a while. The integration of subversion has always hung by a thread. However my subversion server has changed its ip address ... and my xcode project still tries to look up the source on the old ip.
我已经在 Xcode 中运行了一段时间的 subversion。Subversion 的集成一直是一个线程悬而未决的问题。但是我的 subversion 服务器已经改变了它的 ip 地址……我的 xcode 项目仍然试图在旧的 ip 上查找源。
I have changed the ip of the subversion server via the SCM menu in xcode ... however these changes don't seem to effect the project.
我已经通过 xcode 中的 SCM 菜单更改了 subversion 服务器的 ip ......但是这些更改似乎不会影响项目。
Anyone got any idea how I change the subversion ip in the project?
有人知道我如何更改项目中的 subversion ip 吗?
Cheers Rich
干杯丰富
采纳答案by IlDan
It's not Xcode, it's svn itself that still looks to the old reposotory. Try firing up a terminal, and cd'ing into the project directory. There use the switchsvn command:
这不是 Xcode,而是 svn 本身仍然在寻找旧的存储库。尝试启动终端,然后进入项目目录。有使用switchsvn 命令:
svn switch NewURL
then refresh or close/open the Xcode project.
然后刷新或关闭/打开 Xcode 项目。
回答by Chris Kobrzak
I've run into a similar issue when relocating a Subversion repository would be completely ignored by XCode.
当 XCode 完全忽略重新定位 Subversion 存储库时,我遇到了类似的问题。
Here's a list of steps I've taken in order to force Xcode to update the repository path in my project:
这是我为强制 Xcode 更新我的项目中的存储库路径而采取的步骤列表:
Open up Terminal and go to your XCode project directory:
$ cd /path/to/your/project
Switch the Subversion working copy to the new URL (in the example below I also changed the SVN protocol but this is irrelevant):
$ svn switch --relocate svn://old_path svn+ssh://new_path
Fire up XCode, close your project's window and open up Organizer(??2)
- Go to the Projectstab, locate your project in the list on the left, right-click it and click Remove from Organizer...
- Close XCode and open up your .xcodeproj XCode project file again.
打开终端并转到您的 XCode 项目目录:
$ cd /path/to/your/project
将 Subversion 工作副本切换到新 URL(在下面的示例中,我还更改了 SVN 协议,但这无关紧要):
$ svn switch --relocate svn://old_path svn+ssh://new_path
启动 XCode,关闭项目窗口并打开Organizer(??2)
- 转到“项目”选项卡,在左侧列表中找到您的项目,右键单击它并单击“从管理器中删除...
- 关闭 XCode 并再次打开您的 .xcodeproj XCode 项目文件。
You should now see an updated SVN path under the Location heading under Source Control in the File inspector (the Utilities panel).
您现在应该在文件检查器(实用程序面板)的源代码管理下的位置标题下看到更新的 SVN 路径。
If you go to Organizer, you should also see the project back in its place under the Projectstab and a new item under the Repositoriestab.
如果您转到 Organizer,您还应该在Projects选项卡下看到该项目回到原来的位置,并在Repositories选项卡下看到一个新项目。
The environment I've tested this solution in: Mac OS X Mountain Lion + XCode 4.4.1
我在以下环境中测试了此解决方案:Mac OS X Mountain Lion + XCode 4.4.1
回答by Brian Stormont
You need to use the --relocate option for the svn switch command if you are just changing hostnames or ip addresses.
如果您只是更改主机名或 IP 地址,则需要对 svn switch 命令使用 --relocate 选项。
So, something like this:
所以,像这样:
svn sw --relocate svn://[email protected]/mypath svn://[email protected]/mypath
svn sw --relocate svn://[email protected]/mypath svn://[email protected]/mypath
回答by Jasarien
Try creating a new SCM repository and setting your project to the new one, and if that works, you can safely delete the old one.
尝试创建一个新的 SCM 存储库并将您的项目设置为新的,如果可行,您可以安全地删除旧的。
回答by Brynjar
I had similar problems when the dns name for my svn server changed (but keeping the same IP)
当我的 svn 服务器的 dns 名称更改时,我遇到了类似的问题(但保持相同的 IP)
svn sw --relocate worked for me (from terminal on a mac). After the change, go to "Refresh entire project" from the SCM menu in xcode.
svn sw --relocate 对我来说有效(从 Mac 上的终端)。更改后,从 xcode 的 SCM 菜单中转到“刷新整个项目”。
Good idea to do an svn info first though to check your repo URL. On my first attempt I entered the wrong FROM URL and the svn sw --relocate just does nothing, with no error reported.
好主意先做一个 svn 信息来检查你的 repo URL。在我第一次尝试时,我输入了错误的 FROM URL,而 svn sw --relocate 什么也没做,也没有报告错误。
The confusing thing in xcode was the the SCM - repositories browser worked fine after I updated the svn settings in xcode preferences, but my project was not fixed until after the --relocate business.
xcode 中令人困惑的事情是 SCM - 存储库浏览器在我更新 xcode 首选项中的 svn 设置后工作正常,但我的项目直到 --relocate 业务之后才修复。