Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

xcode

svn

xcode4

How do I add a new project to source control (SVN) using Xcode 4?

like image 959
TheLearner Avatar asked Apr 11 '11 08:04

TheLearner


People also ask

How do I add an existing Xcode project to GitHub?

Push your projectGo to Source Control in Xcode and select Projectname -- master, then Configure... In the Address field, paste the Git clone URL for your repo copied in the previous step. Select Add Remote, then select Done to finish creating the origin remote for your local Git repo.

How do I open another project in Xcode?

In the Choose a project pane, choose the Browse button to select an Xcode . pbxproj file. Navigate to the project file in the Select Xcode project file dialog, and then choose Open.

How does Xcode Source Control work?

Overview. Source control is the practice of tracking and managing changes to your code. Manage your Xcode project with source control to keep a rich history of the changes you make, and collaborate on code faster and more effectively. Xcode simplifies source control management with its built-in support for Git.

How do I add an existing remote to Xcode?

So if you go back to Xcode, right click on Remotes, and select Add Existing Remote, a new window will appear from the top prompting for the location. You just need to paste in the URL you got from GitHub, and select Add.


2 Answers

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

like image 136
TheLearner Avatar answered Oct 25 '22 06:10

TheLearner


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 line

1/ Open the Terminal utility and use the svnadmin create command to create a Subversion repository.
For example, if you want a repository named Sketch_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 a mkdir 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, and trunk.

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.

like image 42
VonC Avatar answered Oct 25 '22 08:10

VonC