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.

  • possible duplicate of [Using Git with an existing XCode project](http://stackoverflow.com/questions/5383609/using-git-with-an-existing-xcode-project) – jub0bs Aug 18 '14 at 14:21

1 Answers1

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

Luca Bartoletti
  • 2,435
  • 1
  • 24
  • 46
  • 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. – jub0bs Aug 18 '14 at 14:15
  • I updated the answer to explain better that this "feature" is missing. So i provided the instructions to do it. – Luca Bartoletti Aug 18 '14 at 14:17
  • @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? –  Aug 18 '14 at 14:25
  • 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... –  Aug 18 '14 at 14:26
  • is there any way we can chat about this? –  Aug 18 '14 at 14:28
  • After the creation you should be able to use xcode to manage the repository. – Luca Bartoletti Aug 18 '14 at 14:28
  • 1
    @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](http://git-scm.com/book). – jub0bs Aug 18 '14 at 14:29