First of all, we have to understand two main concepts:
- Local repository (repository that is stored inside your computer)
- Remote repository (repository that is stored online)
As far as I understand, xCode can perform JUST such tasks:
- Work with local repository - make commits (push command)
- Work with remote repository - pull server-saved folders (repositories)
It's a bit weird that it can't make commits to remote repository.
First, make github's account, make repository, follow the GitHub help's steps (1 and 2).
Let's now start making our first project and make it storable online on the remote repository.
- Make a new project in xCode
- When prompt in choosing the path, select "Create local git repository for this project"
- Now you can make changes in your project and commit changes to the LOCAL repository throught Organiser -> Repositories -> YourProjectNameRepo -> YourProjectNameFolder -> Commit
- If you wish to make commits to the Remote repository, just go to Terminal, navigate to your Project's main folder and execute: git push origin master
- All your LOCAL commits will be sent to REMOTE repository
- Go to Organiser -> Repositories -> + -> Add repository... -> Type in your GitHub's repository name -> Paste either SSH path or https, both work.
- Click Clone
- Show xCode where to Download existing repository
- Start working on the project, commit as above.
xCode when making Local repository handles correct .gitignore and .gitconfig, you don't have to mess up with that. Thanks to (buggy) xCode 4.