Many tutorials exist on older Xcode-versions on this subject but here is how I found a solution:
- Create your Xcode project with a local Git repository and write some code
- Create your GitHub remote repository on GitHub but do not initialize it and do not add a readme.md file.
Easiest is to choose a repo name that is identical to your projectname.
- Click Menu-Source Control/"Project name"-master/Configure "Project name"
- Click on the “Remotes” tab
- Click the “Add Remote” button down at the bottom
- In the Add a Remote dialog box you have two fields to fill out
- In the name field enter the name of the GitHub repository you just created
- In the location field paste in the URL from GitHub for your repo
- It will look like this: https://github.com/your-account-name/your-repo-name
- Now you have a connected local and remote repository