29

I have a project using git for version control. I cloned a library to use from GitHub (also presumably using git). I added the downloaded project's .xcodeproj file to my own project and got this dialog:

Share working copy?
A working copy that has not been shared has been added to this workspace. Choose Yes to add this working copy to the Workspace Source Control Data.

What happens if I choose "Yes" or "No"? Which should I choose in this situation?

enter image description here

4
  • What do you mean by 'I added the downloaded project's .xcodeproj file to my own project?' You used 'Add File' or you dragged the .xcodeproj file into the 'Project Navigator' (to add it as a project in a workspace)? Commented Oct 11, 2013 at 21:02
  • @GoZoner I used "Add File". Commented Oct 11, 2013 at 21:47
  • Hmm, what are you trying to accomplish? If you have a workspace and are trying to add a project, then 1) drap the .xcodeprof file to the navigator or 2) select 'add project'. Commented Oct 12, 2013 at 3:45
  • 1
    For me, clicking "Yes" worked out fine. Commented Oct 19, 2013 at 21:19

2 Answers 2

1
+100

I tried adding a second project to my workspace both ways:

  1. Dragging the .xcodeproj file into the Project Navigator

  2. File > Add Files to "WORKSPACE_NAME"...

The alert showed up both ways.

I also tried multiple times, clicking both Yes & No. Either way, none of my files being tracked by Git were changed, which I confirmed with git diff.

I Git ignore xcuserdata though. So, maybe it affects files stored in WORKSPACE_NAME.xcworkspace/xcuserdata/. I didn't check though because, frankly, I don't care about that data.

So, after adding the project to the workspace, I closed the workspace, and ran git clean -dXf (Careful! That command removes all ignored files, which may delete files you want to keep around.) so that if it did change any files that Git isn't tracking, well, now they're gone!

When I open back up the workspace, Xcode regenerates those xcuserdata files anyway.

Sign up to request clarification or add additional context in comments.

1 Comment

What does this answer even mean? I've been tinkering around with iOS apps for a little while by now, and I'm a huge fan of Xcode's magical abilities. I can also confirm that picking either value doesn't seem to affect any files under git version control. But the point is that sadly none of what was mentioned in this answer has had any impact on helping me understand the purpose or consequences of this particular dialog message in Xcode 5.1. FWIW I checked the "Don't ask me again" and picked Yes.
1

Choose Yes.
Then go to Xcode > Preferences and choose the Accounts tab. Now click the + button in the lower lefthand corner and choose Add Repository.... And paste in the HTTPS Clone URL (i.e. https://github.com/samvermette/SVProgressHUD.git) and click Next.

If it's a public repository, you shouldn't need any credentials. Now if you close the Xcode Preferences and select one of the new files you've brought into the project and then view the File Inspector, you should see that Xcode shows you the current source control status for the files that relate to that repository.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.