在 XCode 3/4 中使用 GIT 或 SVN,无需服务器

发布于 2024-10-16 07:46:24 字数 638 浏览 2 评论 0原文

好吧,也许我正在尝试完成一些无法完成的事情。

我是一名单一开发人员(不属于团队)。

我正在尝试让某种版本控制系统运行起来。我曾在 XCode 3 中使用 CVS,但 XCode 4 不再提供此选项。我听说 SVN 和 Git 是更好的选择。

基本上,我已经浪费了半天多的时间试图让 XCode 与 SVN / Git 一起工作。我没有运行服务器,并且不想在服务器上公开我的项目。

对于我来说,拥有一个单独的用户来运行 Git/SVN 服务器也是没有意义的。

我只是想以最简单的方式使用其中之一进行版本控制。

我尝试使用本地文件路径(/Volumes/AAA/BBB/Repo)添加 Repo,我在其中手动创建了“Repo”目录。我已将类型设置为 Subversion(并且还尝试了 Git)。 XCode 说“主机可访问”。但是,提交功能不存在(已禁用)。我无法导入我的工作目录。

我只是不明白 - 我必须有一个服务器运行才能有 SVN/Git,还是 XCode 可以通过命令行来完成?我更喜欢通过命令行完成它,因为服务器完全是多余的。或者,我错过了什么吗?也许我在 XCode 中放入了错误的设置?

这不是严格意义上的 XCode 4 问题,我在 XCode3 中也遇到了同样的问题,但至少它有 CVS 选项 - 现在它已经消失了。

Ok, perhaps I'm trying to accomplish something not doable.

I am a single developer (not part of team).

I'm trying to get some kind of versioning system going. I had used CVS with XCode 3, but XCode 4 no longer has that as an option. I've heard that SVN and Git are better alternatives anyway.

Basically, I've wasted more than half a day trying to get XCode to work with SVN / Git out of the box. I do not have a server running, and would rather not expose my project on a server.

It doesn't make sense for me to have a separate user just to run the Git/SVN Servers, either.

I'm just trying to have version control using either one, in the simplest possible way.

I've tried to add Repo, using local file path (/Volumes/AAA/BBB/Repo) where I manually created the "Repo" directory. I've set the type as Subversion (and also tried Git). XCode says "Host is reachable". But, the Commit functionality is not there (Disabled). I can't import my working directory.

I just don't get it - must I have a server running in order to have SVN/Git, or can XCode just do it through command line? I much more prefer it being done over command line, since the server is complete overkill. Or, am I missing something? Maybe I'm putting in the wrong settings into XCode?

This isn't strictly an XCode 4 issue, I had the same issue with XCode3, but at least it had the CVS option - now it's gone.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

·深蓝 2024-10-23 07:46:24

使用 Git,您不需要中央服务器,甚至不需要中央存储库,除非项目中有多人。 SVN 要求您有一个中央存储库和存储库。服务器一直在运行,但是使用 Git,您可以简单地 git init 一个新的存储库并开始使用它。如果您没有中央存储库,您将永远不会使用 pushpullfetch

With Git you don't need a central server or even a central repository unless you have multiple people on the project. SVN requires you to have a central repo & server running all the time, but with Git you can simply git init a new repo and start using it. If you don't have a central repo you will never use push, pull, or fetch.

云巢 2024-10-23 07:46:24

Xcode 的帮助提到了以下内容:

选择 Git 或 Subversion Xcode 支持两种 SCM 系统:Subversion
(通常缩写为 svn)和 Git。 Subversion 始终基于服务器并且
服务器通常位于远程计算机上,但也可以
在本地安装一个。 Git 可以纯粹用作本地存储库,或者
你可以在远程机器上安装 Git 服务器来共享文件
团队成员。 Xcode 4 安装程序安装 Git 和 Subversion
选择“系统工具”时的工具。如果你一个人工作的话
通常最容易使用 Git,因为您不需要设置服务器。在
事实上,当您使用 Xcode 时,Xcode 可以自动为您设置 Git 存储库。
创建一个新项目(请参阅“为您的新项目创建 Git 存储库”)
项目”)。对于小组项目,Subversion 或 Git 的选择是
通常是品味和先前经验的问题。就目前而言
可能的话,Xcode 提供了一致的用户界面和工作流程
Subversion 或 Git 的用户。

所以官方的建议是,对于你的情况,Git 是最简单的解决方案。我现在的处境与您所描述的相同,并将按照建议尝试 Git。

之前在一家小公司工作时,我们使用了一台专用的剩余MacMini作为SVN服务器;这很容易设置,并且多年来一直发挥着作用。请注意,Xcode 3 的 SVN 集成比 Xcode 4 更好,因此我最终使用 Xcode 4 进行开发和基本 SVN 使用,同时使用 Xcode 3 进行 Xcode 4 不再做的 SVN 功能。

Xcode's help mentions the following:

Choose Git or Subversion Xcode supports two SCM systems: Subversion
(often abbreviated svn) and Git. Subversion is always server-based and
the server is normally on a remote machine, though it is possible to
install one locally. Git can be used purely as a local repository, or
you can install a Git server on a remote machine to share files among
team members. The Xcode 4 installer installs the Git and Subversion
tools when you select System Tools. If you are working alone, it’s
generally easiest to use Git, as you don’t need to set up a server. In
fact, Xcode can automatically set up a Git repository for you when you
create a new project (see “Create a Git Repository For Your New
Project”). For a group project, the choice of Subversion or Git is
usually a matter of taste and prior experience. In so far as is
possible, Xcode provides a consistent user interface and workflow for
users of either Subversion or Git.

So the official advise is that in your case, Git is the easiest solution. I'm now in the same position as you described and will be trying Git as advised.

Previously, when working for a small company, we used a dedicated leftover MacMini as an SVN server; this was quite easy to set up, and worked like a charm for many years. Be aware that the SVN integration of Xcode 3 was better than that of Xcode 4 though, so that I ended up using Xcode 4 for development and basic SVN usage, together with Xcode 3 for SVN stuff that Xcode 4 wouldn't do anymore.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文