1

My question is quite simple. I have an XCode project, and I did not select the "create git repository" option. I would like to use Git within XCode, because it seems like Apple simplified the process of using Git within XCode so I don't have to deal with the command line tool.

However, I don't see any option to add a git repository. The "source control" menu is all grayed-out. Surely there is a way to add one?

It wouldn't really make sense to me that I couldn't add one now - this would seem like a huge hole in the features of XCode.

1

1 Answer 1

2

I agree with you are assumption. This feature is missing.

But you can do it from the shell following this instructions

http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository

Do it in the main directory of your project.

Basically you need to run this line

$ git init

And your git local rep is ready. Use xCode from now on

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

7 Comments

I don't think this qualifies as an answer, because the OP wants to know how to create a repo from within XCode, not at the command line.
I updated the answer to explain better that this "feature" is missing. So i provided the instructions to do it.
@lucaBartoletti forgive me, but could you verify that the following is correct: I run "git init" in the outermost directory of my project that contains everything, then I have to "add" every single file, including pictures, texture atlases, code files, etc, then do a "git commit" and it will add those files to my repository? seems cumbersome to have to "add" every file everytime, or do you only "add" files you've changed? also, where is this git repository created? can my coworker pull from it or, how do i set it up on github?
im confused because i read the git tutorials on their site, but they all reference "[url]" and really don't explain at all how it works - they skip right from creating a git repository to using remotes and don't explain if [url] creates a new url, or uses an existing one on github, and how you have to name your url so that it gets created properly, and how to add other users to that url...
@user2391236 That's a lot of questions that are unlikely to get answered on this page. No offense, but you don't seem familiar enough with Git, yet. You should read the first two chapters of the Pro Git book.
|

Your Answer

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