草庐IT

ios - 如何在 Xcode 6 上设置 svn 存储库?

coder 2023-09-24 原文

我刚开始使用 Xcode 并尝试在远程 Windows 服务器上添加一个 Subversion 存储库。当我输入 Subversion 存储库的位置路径时,它显示以下错误消息:

错误信息 :

“主机无法访问。”

请问有人可以帮忙吗?谢谢。

最佳答案

即使没有 Xcode,设置 svn 源代码控制也总是很痛苦,而且 Apple 无法通过与 Xcode 的集成来帮助它。它从一个版本到另一个版本,最新的版本与版本 5 相似,因此在 Xcode 6 中也是如此。
这个解决方案的唯一问题是我们总是必须结合命令行和 Xcode GUI 步骤,但这是唯一可行的解​​决方案,所以我们将遵循这一点,但在可能的情况下使用 Xcode。

由于我做了几次但总是遇到各种问题,我决定做一个详细而清晰的最新描述。

The server side



即使您可以在您的机器上安装 svn 服务器,即使您单独工作,这也不是一个安全的解决方案。您可能会因硬盘故障或任何事故而失去多年的工作。所以把它放在单独的电脑上。
您需要在其上安装 svn 服务器并登录。您可以检查它,只需 ssh 进入您的服务器并在终端中使用该命令
which svn

如果你得到了一个版本号,你可能在该服务器上有一个带有事件存储库目录的 svn 并且你可以访问它。确切的位置取决于您的安装,但在我们的例子中,主存储库目录是:https://myserver.me.com/Library/Subversion/Repository/

您将在此目录下创建新的存储库,例如
https://myserver.me.com/Library/Subversion/Repository/MyNewApp

1. 创建一个新的存储库

登录到您的服务器(在我们的例子中是 myserver.me.com),然后打开终端实用程序并使用 svnadmin create 命令创建一个 Subversion 存储库。
例如,如果您想要一个名为 MyNewApp 的存储库在现有位置/Library/Subversion/Repository/ ,您将输入命令:
svnadmin create /Library/Subversion/Repository/MyNewApp

这将创建存储库的主要结构。我们从服务器注销以避免任何问题,并且从现在开始不要直接使用它,只是从客户端使用。

The client side



2.创建文件夹结构

Note: Creating a hierarchy for your repository is optional. It's not needed in order to get svn to work properly, but if you're planning on keeping multiple projects under source control, then it's a good idea to get organized before you start importing those projects.



我们将在客户端准备文件夹结构,然后我们将使用名为“import”的 svn 命令将其传输到服务器。

1.首先在您的客户端上的任何位置创建一个新的临时文件夹 - 例如在您的桌面上 - 在我们的案例 MyNewApp 中使用 Finder 中的项目/存储库名称:
MyNewApp

然后使用确切名称在其中创建 3 个其他文件夹:
trunk
branches
tags

2.将文件夹结构导入svn服务器

使用终端实用程序登录到您的客户端并使用“cd”命令进入项目文件夹:
cd MyNewApp

Tip: The easiest way to get the full path to a folder into Terminal without risking typing errors is to first type the cd command and enter a space, and then drag the folder from the Finder and drop it at the end of the Terminal command line.



3.然后从终端使用 svn import 命令:
svn import . https://myserver.me.com/Library/Subversion/Repository/MyNewApp -m "Initial import of directories for MyNewApp project."

或者
svn import . svn+sshtunnel://yourLoginName@194.149.155.124/Library/Subversion/Repository/MyNewApp -m "Initial import of directories for MyNewApp project."

第二种是使用 ssh key 最安全的用法,其中 194.149.155.124 是服务器的 IP 地址。 svn+sshtunnel://意味着它使用 svn 和 sshtunnel 但它可以是任何其他的,这取决于登录机制,如 https://svn://这 ”。”在“导入”命令很重要之后,它意味着您所在的文件夹。

如果导入成功,您应该会看到如下内容:
Adding trunk 
Adding branches
Adding tags

Committed revision 1.

Note: This means this is the first committed version you loaded to the server to MyNewApp repository and it's under revision control by svn with a message just referencing what you did, and you could use what you like. Now that you have imported the directory structure for your project into the repository, you can now delete the MyNewApp1 directory on your computer that you just created. Doing this will help to prevent confusion later, when you import the real project.



3.将Xcode工程导入svn

使用终端导航到您的 Xcode 项目并再次确保您位于项目文件夹中
cd MyNewApp

然后再次使用以下 svn 命令:
svn import . https://myserver.me.com/Library/Subversion/Repository/MyNewApp/trunk/MyNewApp1  -m "Initial import of MyNewApp1 project."

或在您的计算机上的确切位置/Users/myUserName/Apps_Developing/myNewApp
svn import -m "New Import"  /Users/myUserName/Apps_Developing/myNewApp https://myserver.me.com/Library/Subversion/Repository/MyNewApp/trunk/MyNewApp1

如果导入成功,您应该会看到一长串添加的文件...

Note: This means that you import the MyNewApp1 (you could use any name) project to the trunk under svn. The trunk extension is important because of naming convention used by Xcode too. Again you can include any comment you want in the quotation marks, but be sure your comment will be meaningful to anyone using the repository.



4.在Xcode中添加仓库

现在启动 Xcode 并转到 Preferences --> Accounts并在左下角添加带有“+”的新存储库
+ Add Repository...

输入仓库地址
https://myserver.me.com/Library/Subversion/Repository/MyNewApp



Note: Don't use the trunk etc. you need the root of the repository here!



5. checkout 项目以创建工作副本

在 Xcode 中转到 Source Control --> Check Out...
输入主干(或分支或标签,如果您之前使用过它们)的存储库地址
https://myserver.me.com/Library/Subversion/Repository/MyNewApp/trunk

然后给出工作副本文件夹的名称及其位置



Note: trunk is important!!! Just type it after the root, if you miss it there will be trunk etc. folders in your folder! Directory name is as you like for example MyNewAppWorking...then choose location on your computer like Apps_Developing in our case.

关于ios - 如何在 Xcode 6 上设置 svn 存储库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29599023/

有关ios - 如何在 Xcode 6 上设置 svn 存储库?的更多相关文章

  1. ruby - 使用 RubyZip 生成 ZIP 文件时设置压缩级别 - 2

    我有一个Ruby程序,它使用rubyzip压缩XML文件的目录树。gem。我的问题是文件开始变得很重,我想提高压缩级别,因为压缩时间不是问题。我在rubyzipdocumentation中找不到一种为创建的ZIP文件指定压缩级别的方法。有人知道如何更改此设置吗?是否有另一个允许指定压缩级别的Ruby库? 最佳答案 这是我通过查看ruby​​zip内部创建的代码。level=Zlib::BEST_COMPRESSIONZip::ZipOutputStream.open(zip_file)do|zip|Dir.glob("**/*")d

  2. ruby - 如何在 Ruby 中顺序创建 PI - 2

    出于纯粹的兴趣,我很好奇如何按顺序创建PI,而不是在过程结果之后生成数字,而是让数字在过程本身生成时显示。如果是这种情况,那么数字可以自行产生,我可以对以前看到的数字实现垃圾收集,从而创建一个无限系列。结果只是在Pi系列之后每秒生成一个数字。这是我通过互联网筛选的结果:这是流行的计算机友好算法,类机器算法:defarccot(x,unity)xpow=unity/xn=1sign=1sum=0loopdoterm=xpow/nbreakifterm==0sum+=sign*(xpow/n)xpow/=x*xn+=2sign=-signendsumenddefcalc_pi(digits

  3. ruby-openid:执行发现时未设置@socket - 2

    我在使用omniauth/openid时遇到了一些麻烦。在尝试进行身份验证时,我在日志中发现了这一点:OpenID::FetchingError:Errorfetchinghttps://www.google.com/accounts/o8/.well-known/host-meta?hd=profiles.google.com%2Fmy_username:undefinedmethod`io'fornil:NilClass重要的是undefinedmethodio'fornil:NilClass来自openid/fetchers.rb,在下面的代码片段中:moduleNetclass

  4. ruby - 如何在 buildr 项目中使用 Ruby 代码? - 2

    如何在buildr项目中使用Ruby?我在很多不同的项目中使用过Ruby、JRuby、Java和Clojure。我目前正在使用我的标准Ruby开发一个模拟应用程序,我想尝试使用Clojure后端(我确实喜欢功能代码)以及JRubygui和测试套件。我还可以看到在未来的不同项目中使用Scala作为后端。我想我要为我的项目尝试一下buildr(http://buildr.apache.org/),但我注意到buildr似乎没有设置为在项目中使用JRuby代码本身!这看起来有点傻,因为该工具旨在统一通用的JVM语言并且是在ruby中构建的。除了将输出的jar包含在一个独特的、仅限ruby​​

  5. ruby - 什么是填充的 Base64 编码字符串以及如何在 ruby​​ 中生成它们? - 2

    我正在使用的第三方API的文档状态:"[O]urAPIonlyacceptspaddedBase64encodedstrings."什么是“填充的Base64编码字符串”以及如何在Ruby中生成它们。下面的代码是我第一次尝试创建转换为Base64的JSON格式数据。xa=Base64.encode64(a.to_json) 最佳答案 他们说的padding其实就是Base64本身的一部分。它是末尾的“=”和“==”。Base64将3个字节的数据包编码为4个编码字符。所以如果你的输入数据有长度n和n%3=1=>"=="末尾用于填充n%

  6. ruby-on-rails - 如何在 ruby​​ 中使用两个参数异步运行 exe? - 2

    exe应该在我打开页面时运行。异步进程需要运行。有什么方法可以在ruby​​中使用两个参数异步运行exe吗?我已经尝试过ruby​​命令-system()、exec()但它正在等待过程完成。我需要用参数启动exe,无需等待进程完成是否有任何ruby​​gems会支持我的问题? 最佳答案 您可以使用Process.spawn和Process.wait2:pid=Process.spawn'your.exe','--option'#Later...pid,status=Process.wait2pid您的程序将作为解释器的子进程执行。除

  7. ruby - 如何在续集中重新加载表模式? - 2

    鉴于我有以下迁移:Sequel.migrationdoupdoalter_table:usersdoadd_column:is_admin,:default=>falseend#SequelrunsaDESCRIBEtablestatement,whenthemodelisloaded.#Atthispoint,itdoesnotknowthatusershaveais_adminflag.#Soitfails.@user=User.find(:email=>"admin@fancy-startup.example")@user.is_admin=true@user.save!ende

  8. ruby-on-rails - 如何使用 instance_variable_set 正确设置实例变量? - 2

    我正在查看instance_variable_set的文档并看到给出的示例代码是这样做的:obj.instance_variable_set(:@instnc_var,"valuefortheinstancevariable")然后允许您在类的任何实例方法中以@instnc_var的形式访问该变量。我想知道为什么在@instnc_var之前需要一个冒号:。冒号有什么作用? 最佳答案 我的第一直觉是告诉你不要使用instance_variable_set除非你真的知道你用它做什么。它本质上是一种元编程工具或绕过实例变量可见性的黑客攻击

  9. ruby - 如何在 Ruby 中拆分参数字符串 Bash 样式? - 2

    我正在为一个项目制作一个简单的shell,我希望像在Bash中一样解析参数字符串。foobar"helloworld"fooz应该变成:["foo","bar","helloworld","fooz"]等等。到目前为止,我一直在使用CSV::parse_line,将列分隔符设置为""和.compact输出。问题是我现在必须选择是要支持单引号还是双引号。CSV不支持超过一个分隔符。Python有一个名为shlex的模块:>>>shlex.split("Test'helloworld'foo")['Test','helloworld','foo']>>>shlex.split('Test"

  10. ruby - 如何在 Lion 上安装 Xcode 4.6,需要用 RVM 升级 ruby - 2

    我实际上是在尝试使用RVM在我的OSX10.7.5上更新ruby,并在输入以下命令后:rvminstallruby我得到了以下回复:Searchingforbinaryrubies,thismighttakesometime.Checkingrequirementsforosx.Installingrequirementsforosx.Updatingsystem.......Errorrunning'requirements_osx_brew_update_systemruby-2.0.0-p247',pleaseread/Users/username/.rvm/log/138121

随机推荐