-1

I've read that developers really need source control. Now I never used it before and I'm a bit lost with my existing projects.

How do I setup it?

There's already a File path inside of it, but it goes to nothing? I don't even know what it does in there.. I want a local git for my own. I found how to set it up with Terminal. But I think there should be a right way on doing this with Xcode and not with Terminal?

First image off Xcode Second image of Xcode

3
  • You should specifically google "git in xcode" if that is what you want to know. Here is a result. If you don't know anything about Git, there is this stackoverflow question. And this question about git and xcode. Commented May 9, 2014 at 17:33
  • Just realized that the existing project part could make this more difficult in XCode. But with git on the command line, it's completely straightforward. On a new project, I guess it just does the init for you. Commented May 9, 2014 at 17:59
  • 1
    Just run git init and git add . in the project's directory. From there, you can use all the GUI front-end features of Xcode's source control. Commented May 9, 2014 at 18:22

1 Answer 1

1

I'm sorry to say that Xcode does not have an option to place an existing project under version control. You can however use GitHub for Mac which will allow you to do this. It also has convenient merging tools and lets you push your code to GitHub.com if you like, all at the touch of a button: https://mac.github.com

It's easy enough to create a git repo from the command line though: open Terminal and navigate to the root folder of your project. Then type the following:

git init
git add .
git commit -m "initial commit"

Note that this approach as well as GitHub for Mac will version control every file in your project - which is not what Xcode does when you start a new project with Git enabled. You may run into trouble because your user interface state changes once every second - which can make committing and merging difficult.

The following article discusses this in detail: http://pinkstone.co.uk/how-to-place-an-exiting-xcode-project-under-version-control-with-git-and-ignore-files-you-dont-want-to-track/

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

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.