如何取消与已死的SVN服务器的Xcode 5项目的工作副本的关联 [英] How to disassociate working copy of an Xcode 5 project from SVN server that died

查看:72
本文介绍了如何取消与已死的SVN服务器的Xcode 5项目的工作副本的关联的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Xcode 5项目的修改后的工作副本,该项目已从不再可用的远程svn服务器中签出.如何删除工作副本的svn关联并使之不受源代码控制? (最终,我想基于工作副本创建一个git存储库,并对其进行推送修改.)我不需要保留svn历史记录.

I have a modified working copy of an Xcode 5 project that was checked out from a remote svn server that is no longer available. How can I remove the working copy's svn association and have it not be under source control? (Eventually I want to create a git repository based on the working copy and push modifications to it.) I don't need to retain the svn history.

我已经尝试了一些显而易见的措施来将svn服务器与项目解除关联(例如删除工作副本中的.svn目录,以及通过svn服务器名称中的所有文件进行grep -r搜索工作副本目录树),但项目仍与svn服务器关联.我宁愿直接使用工作副本进行此切换,而不必冒险尝试创建一个不与svn服务器关联的空工作副本",然后从当前副本一个接一个地传输文件.像svn-git之类的工具不可行,因为这两个svn服务器都不可用,并且我的工作副本包含大量修改.帮助...?

I've tried the obvious things to disassociate the svn server from the project (such as deleting the .svn directories in the working copy as well as doing a grep -r search on the svn server's name through all the files in the working copy directory tree), but the project remains associated with the svn server. I'd prefer to do this switch directly with the working copy, rather than risking trying to create an empty "working copy" that is not associated with the svn server and then transferring files one-by-one from the current copy. Tools like svn-git aren't feasible as both the svn server isn't available and my working copy contains significant modifications. Help...?

推荐答案

我设法找到了一种方法,尽管可能不是最简单或推荐的过程.这就是让我实现将工作副本推送到远程git服务器的最终目标的原因:

I managed to find a way, although probably not the easiest or recommended procedure. Here's what got me to my eventual goal of having the working copy pushed to a remote git server:

  1. 通过删除.svn文件等从工作副本中删除所有SVN信息.(我在问原始问题之前就已经这样做了.)
  2. 在远程git服务器上为项目创建一个空的存储库
  3. 在Xcode的帐户中添加远程git服务器
  4. 关闭Xcode中的所有项目,然后取消选择启用源代码管理" 在Xcode偏好设置中;退出Xcode
  5. 将工作副本重命名为临时名称
  6. 启动Xcode,选择启用源代码控制",然后从远程git服务器中将空存储库检出到具有原始工作副本名称的目录中;再次禁用源代码管理,退出Xcode
  7. 将检出的(空)工作副本中的.git目录移动到原始工作副本目录(在步骤5中已重命名);删除空的工作副本,然后将原始工作副本重命名为其原始名称
  8. 启动Xcode并打开工作副本项目; SVN关联应该消失了
  9. 重新启用源代码控制,并且工作副本现在应与远程git存储库相关联,但不添加任何文件
  10. 打开实用程序"检查器,并注意标识和类型"窗格的源代码控制"区域中的微小添加"按钮;单击添加以将所有文件标记为已添加
  11. 像往常一样提交并推送
  1. Remove all SVN information from the working copy by deleting .svn file, etc. (I'd done this before asking my original question.)
  2. Create an empty repository for the project on the remote git server
  3. Add the remote git server in Xcode's Accounts
  4. Close all projects in Xcode and then unselect Enable Source Control in the Xcode Preferences; quit Xcode
  5. Rename the working copy to a temporary name
  6. Launch Xcode, select Enable Source Control, and then checkout the empty repository from the remote git server into a directory with the original working copy name; again disable source control, quit Xcode
  7. Move the .git directory from the checked out (empty) working copy into the original working copy directory (which was renamed in step 5); delete the empty working copy and rename the original working copy back to its original name
  8. Launch Xcode and open the working copy project; the SVN association should be gone
  9. Reenable source control, and the working copy should now be associated with the remote git repository, but with no files added
  10. Open the Utilities inspector and note the tiny Add button in the Source Control area of the Identity and Type pane; click Add to have all the files marked as Added
  11. Commit and push as usual

Voila!我的工作副本现在位于git下,并且具有远程git服务器关联.当然,SVN的历史已经丢失,但这对我来说不是问题.必须有一个简短的配方,但是我想分享一下上面的内容,以防它使任何人陷入类似的困境.

Voila! My working copy is now under git with a remote git server association. Of course, the SVN history has been lost, but that was not a concern for me. There has to be a shorter recipe, but I wanted to share the above in case it saves anyone in s similar predicament.

这篇关于如何取消与已死的SVN服务器的Xcode 5项目的工作副本的关联的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆