How do I add a new project to source control (SVN) using Xcode 4?
Open Organizer. Click on the root of your SVN repository in the tree on the left. Click on Import on the bottom right and choose the directory from finder that you want to add and click Import.
This will add the project to SVN
The XCode 4 documentation recommend using command-line tools or a utility program to set up a Git or Subversion repository.
To set up a Subversion repository using the command line1/ Open the Terminal utility and use the
svnadmin
create command to create a Subversion repository.
For example, if you want a repository namedSketch_svn
in the existing location/Users/myUserName/Repositories
, you would enter the command:
svnadmin create /Users/myUserName/Repositories/Sketch_svn
Tip: The easiest way to get the full path to a folder into Terminal without risking typing errors is to first type the command (
cd
in this case), enter a space, and then drag the folder from the Finder and drop it at the end of the Terminal command line.Note that the directory
/Users/myUserName/Repositories/
must already exist before you execute this command. You can use the Finder or amkdir
command to create the directory.2/ In another location—not in the repository you just created—create a folder to hold a temporary copy of the project. In that folder, create three additional folders named
branches
,tags
, andtrunk
.3/ Create a new Xcode project in the trunk folder, using Xcode, or put your existing project in the
trunk
folder, using the command line or the Finder.4/ Use the svn import function to import your project into the repository you created and place it under Subversion source control.
For example, if your temporary copy is in/Users/myUserName/Projects/Sketch_tmp
, you would enter the following command in Terminal:
svn import /Users/myUserName/Projects/Sketch_tmp \
file:///Users/myUserName/Repositories/Sketch_svn -m "Initial import"
Notes
- The backslash at the end of the first line indicates that the command is continued on the next line. You can omit the backslash and type the entire command on one line. If you do use the backslash, be sure there are no spaces following it before you press Return.
- There are three forward slashes in the string
file:///
.- If you type the entire command on one line, be sure there is a space before
file:///
.- You can include any comment you want in the quotation marks, but be sure your comment will be meaningful to anyone using the repository.
5/ In the repositories organizer in Xcode, click the Add (
+
) button at the bottom of the navigator pane, and choose Checkout Repository to create a working copy.
Use Terminal. At the command line, you can use the svn import
command to add the project to your repository.
From the way you worded your question, I'm assuming that your subversion repository already exists. You'll follow the same basic steps outlined in Add Git or Subversion Version Control to an Existing Project in the Xcode 4 Users Guide, except that instead of creating a whole new repository you'll just add a new directory to your existing repository.
It's handy that Xcode has support for version control, but it's not a full-featured GUI version control client. You should still know how to manage your repository using the svn command line program. Alternately, you can get a GUI front end like Versions. Either way, you should have (and have read) the Subversion Book. There's a lot more to using version control than just checking files in and out, and you need to know how it works and how best to use it if it's going to help you.
© 2022 - 2024 — McMap. All rights reserved.