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.
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
.
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.
精彩评论