如何在 Xcode 5 中向源代码管理添加新项目?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19179612/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 04:00:38  来源:igfitidea点击:

How to add a new project to source control in Xcode 5?

iphoneobjective-cxcodeipad

提问by Ayaz

enter image description hereHow do I add a new project to source control (SVN) using Xcode 5?

在此处输入图片说明如何使用 Xcode 5 将新项目添加到源代码管理 (SVN)?

In "Source Controller" only checkout is clickable and all other are unclickable.

在“Source Controller”中,只有 checkout 是可点击的,所有其他的都是不可点击的。

i have existing copy of my project. And i want to upload this app on SVN. how add existing copy to SVN in XCode 5.

我有我的项目的现有副本。我想在 SVN 上上传这个应用程序。如何在 XCode 5 中将现有副本添加到 SVN。

As in image you can see all other options are unclickable. i want to add this project to SVN.

如图所示,您可以看到所有其他选项都无法点击。我想将此项目添加到 SVN。

回答by Piyush

Use following steps for checkout latest version from SVN server

使用以下步骤从 SVN 服务器签出最新版本

  • Xcode click on checkout button (Source Control -> checkout)
  • Enter your repository location and click next
  • Select project from project list (Stored on svn server)
  • Select location where you want to store project and press checkout enter image description here
  • Xcode 单击结帐按钮(源代码管理 -> 结帐)
  • 输入您的存储库位置,然后单击下一步
  • 从项目列表中选择项目(存储在 svn 服务器上)
  • 选择您要存储项目的位置,然后按结帐 在此处输入图片说明

Upload existing project to SVN server

将现有项目上传到 SVN 服务器

  • Open terminal and move to your project path
  • cd 'Your project path'
  • In following comment add server path and execute it
  • svn import 'Your Project Path' 'Server path' "Initial Import”
  • 打开终端并移动到您的项目路径
  • cd '你的项目路径'
  • 在下面的注释中添加服务器路径并执行它
  • svn import '您的项目路径' '服务器路径' “初始导入”

回答by Lorenzo Bevilacqua

First of all you should close Xcode, locate your project in the Finder, and create a directory hierarchy appropriated for SVN

首先,您应该关闭 Xcode,在 Finder 中找到您的项目,然后创建适合 SVN 的目录层次结构

/projectdir
/projectdir/branches
/projectdir/tags
/projectdir/trunk

Then, you should put your Xcode project directory into trunk. Once you've done that, and created your repository on your server using svnadmin create PATH-TO-PROJECTDIR, you can import your local copy into the newly created repository on the server. Note that svnadmin doesn't create intermediate directories contained in PATH-TO-PROJECTDIR. Use svn import projectdir svn+ssh://your-server-url/your-repository-path -m "First commit". Now you are able to check out your trunk (with Xcode or svn command) and version control in Xcode will be enabled.

然后,您应该将 Xcode 项目目录放入trunk. 完成此操作并使用在服务器上创建存储库后svnadmin create PATH-TO-PROJECTDIR,您可以将本地副本导入服务器上新创建的存储库。请注意,svnadmin 不会创建包含在 PATH-TO-PROJECTDIR 中的中间目录。使用svn import projectdir svn+ssh://your-server-url/your-repository-path -m "First commit". 现在您可以检查您的主干(使用 Xcode 或 svn 命令)并启用 Xcode 中的版本控制。