Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 5 - How to use source control with a workspace

I've created myself a Xcode 5 workspace and added 2 projects into it. The first project is a Mac OS X Cocoa Application and the second is an External Build System.

When creating the projects I checked the option so it would create a git repository for each. Then, I've tried looking at the menu item Source Control and every sub item was grayed out except Check Out ... which is not what I want to do. I wish to add the files to the repo.

How can use source control in Xcode 5 with a workspace?


Edit: I've tried to create the projects without the git source control option and creating the git repositories manually from the Terminal. Sadly, Xcode is not detecting them.

like image 592
Alerty Avatar asked Mar 03 '14 01:03

Alerty


1 Answers

Finally, I've found a solution to my problem.

I created the workspace with the projects inside without any source control options. Then, I manually created a single git repo inside my source folder by doing the following in the Terminal.

cd /path-to-my-source-code/.git
git init
git add . 

After, I added a .gitignore file inside the .git folder as suggested in https://stackoverflow.com/a/12021580/209824.

The final step was to restart Xcode.

like image 119
Alerty Avatar answered Oct 12 '22 16:10

Alerty